Ferdinand I, the last king of the first dynasty (1367-1383) had a troubled reign, marked by the three wars fought with the neighbouring kingdom of Castile (known as the Fernandine Wars). He also established the first treaty bringing about the political-military alliance between the kingdoms of Portugal and England (June, 1373), which exists to this day.
During the second war (1372-1373), there was a brief siege of Lisbon (23 February to 19 March 1373) by the forces of Henry II of Castile, as well as a naval battle off the city (7 March), won by the Castilian fleet. These events persuaded Ferdinand to build a new wall, as Lisbon had long since spilt beyond the limits of the Old Wall, with the suburbs that had extended to the west (the Baixa valley) and east (Alfama). Built in record time, residents from all over Lisbon and the neighbouring districts of Estremadura helped out and more than doubled the city footprint.
The third and last war (1381-1382) featured the participation of English troops. King Edward III’s youngest son (Edmund of Langley – Earl of Cambridge and later Duke of York) commanded a fleet to assist King Ferdinand in the conflict. According to Fernão Lopes, in 1382 the Earl of Cambridge and his wife, Isabella of Castile, were hosted by King Ferdinand and Leonor Teles “at the king’s palaces at the castle, where everyone was received most honourably” (Chronicle of King Ferdinand, Chapter CXXIX).