A new chapter in the history of Lisbon was written with the social revolution of the 1383-1385 Crisis. This was a time of civil war in Portugal when no crowned king reigned. It began when King Ferdinand I of Portugal died without male heirs, and his kingdom ostensibly passed to the King of Castile, John I of Castile. The powerful aristocrats and clerics in the north of Portugal owned large estates in the south acquired during the redistribution of land after the Reconquista; their cultural point of view was similar to that of the Castilians, with an emphasis on social distinctions based on the possession of land. They were invested in the spirit of Crusade against the Moors from the Maghreb and the potential benefits of the union of all Hispania. However, these were not the main concerns of the merchants of Lisbon (many of them small gentry). For them, union with Castile meant a severing of trade links with England and the countries of northern Europe, and also with the Middle East; as well as a diversion of attention from their privileges and the building of commercial ships to the privileges of the nobles (fidalgos) and the waging of war with land armies. This helps explain why the merchants and lesser nobles supported the cause of the Master of Avis.
The war fought in 1383-1385 was at bottom a war between the conservative land-owning medieval aristocracy (very similar to and allied with their Galician and Castilian counterparts) centred in the former County of Portugal in Minho (except the bourgeois city of Porto, a Lisbon ally, among a few other cities and personages of the north), and the rich merchants of the pluralistic society of Lisbon. The nobles had reclaimed the country from the Muslims and founded the northern counties—as their alliance with the Castilian nobility was reestablished, the increasing dominance of Lisbon threatened their supremacy. For the merchants of Lisbon, a commercial city, the feudal practices and land wars of the Castilians were a threat to their business interests. It was the bourgeoisie who, with their English connections and substantial capital, would win the struggle. The Master of Avis was acclaimed King John I of Portugal, his forces having survived the Siege of Lisbon in 1384 and won the Battle of Aljubarrota in 1385 against the forces of Castile and the northern Portuguese nobles, under the leadership of his constable Nuno Álvares Pereira. The new Portuguese aristocracy rose from the merchant class of Lisbon, and it is only from this date that the centre of power in north Portugal actually moved to Lisbon, it becoming a sort of city-state, whose interests almost entirely determined the course of the country’s independence.
The new bourgeois nobles built their palaces and stately homes in the Santos neighbourhood; other important buildings included the University, which had returned to Lisbon in the Alfama; the Carmo Church (Igreja do Carmo); the Alfândega (Customs Building); and some of the first residential buildings built in medieval Europe with several floors (up to five). The town had the narrow, winding streets characteristic of medina quarters, mostly unpaved, its houses alternating with gardens and orchards. As the city continued to grow, the widespread abandonment of highly productive Moorish irrigation techniques meant that it had to import wheat from Castile, France, the Rhineland and even Morocco. With this expansion into the countryside, the adjacent territory became suburbs like those of other European commercial cities. Lisbon, along with Antwerp, served the same function of an organised trade centre on the Atlantic coast as Venice, Genoa, Barcelona or Ragusa on the Mediterranean; or Hamburg, Lubeck and the other cities on the Baltic Sea. Wanting to improve public hygiene, the city council in 1417 prohibited garbage piles near the Carmo Monastery and other areas, and in 1426 another law was enacted prohibiting the dumping of trash in the streets, under penalty of paying a fine.
Portuguese foreign policy promoted the interests of Lisbon: trade and cooperation agreements were signed with the commercial city-states of Venice (accord of 1392), Genoa (1398), Pisa and Florence, whose merchants had already formed communities in the city, and many of whom were naturalised and married into the Portuguese nobility. Ceuta on the north African coast was captured by the Portuguese during the Battle of Ceuta in 1415, giving Lisbon’s merchants a base from which to attack Saracen pirates and better local control of the Mediterranean trade that passed through the Strait of Gibraltar, as well as the importation of Moroccan wheat at the best prices. Moreover, at this time Ceuta received caravans bearing gold and ivory, a trade Lisbon wanted to dominate, and it was feared that its Castilian rivals in Seville or the Aragonese of Barcelona might seize the outpost. A renewed alliance with England, one of its most important trade partners, was pursued.