Earl Ralph had secured control of the castle at Dol, and in September 1076 William advanced into Brittany and laid siege to the castle. King Philip of France later relieved the siege and defeated William at the Battle of Dol, forcing him to retreat back to Normandy. Although this was William's first defeat in battle, it did little to change things. An Angevin attack on Maine was defeated in late 1076 or 1077, with Count Fulk le Rechin wounded in the unsuccessful attack. More serious was the retirement of Simon de Crépy, the Count of Amiens, to a monastery. Before he became a monk, Simon handed his county of the Vexin over to King Philip. The Vexin was a buffer state between Normandy and the lands of the French king, and Simon had been a supporter of William. William was able to make peace with Philip in 1077 and secured a truce with Count Fulk in late 1077 or early 1078.