William Longsword attacked Flanders in 939 and Arnulf I, Count of Flanders, and Louis IV, King of France, attacked Normandy because of this. Arnulf captured the castle of Montreuil-sur-Mer defeating Herluin, Count of Ponthieu. Herluin helped William Longsword to take back the castle. William was excommunicated for attacking and destroying lands belonging to Arnulf. William pledged his loyalty to King Louis IV when they met in 940. In return for this he was confirmed in lands that had been given to his father, Rollo. Almost three years later, on 17 December 942 at Picquigny on the Somme, William Longsword was attacked and killed by followers of Arnulf while at a peace conference to settle their differences.