The de Valence family held Pembroke for 70 years. During this time, the town was fortified with defensive walls, three main gates and a postern. Pembroke Castle became de Valence's military base for fighting the Welsh princes during the conquest of North Wales by Edward I between 1277 and 1295. On the death of Aymer de Valence, 2nd Earl of Pembroke, William de Valence's son, the castle passed through marriage to the Hastings family. In 1389, 17-year-old John Hastings died in a jousting accident, ending a line of inheritance stretching back 250 years.