In his home county, William fought with Countess Margaret II of Flanders for control of Zeeland. As king of Germany, he made himself count of Zeeland. In July 1253, he defeated the Flemish army at Westkapelle (in modern-day Belgium) and a year later a cease-fire followed. His anti-Flemish policy worsened his relationship with France. From 1254 to his death he fought a number of wars against the West Frisians. He built some strong castles in Heemskerk and Haarlem and created roads for the war against the Frisians.