In 1383 King Ferdinand I of Portugal was dying, due to this he had to choose a successor and the most serious problem was that the king had only had one daughter named Beatriz. Several dynastic houses would present their candidates to the throne among which were English princes, French and some members of Portuguese noble houses, at the end Fernando let his wife Leonor take the decision of succession and she would choose Juan I of Castilla.
Although the marriage between Beatriz and Juan de Castilla occurred in 1383, it was not the best solution for the Portuguese dynastic problems because this union would cause Portugal a relatively small kingdom to lose its independence in favor of the Castilians, many nobles and the traditional aristocracy They would oppose this union but they would not achieve anything significant. there were other candidates from illegitimate lines such as Juan de Portugal and Juan de Avis.
The people of different cities such as Lisboa, Oporto, Evora, Beja, among others; they rose up in favor of Juan de Avis, seeing him as a just person who would defend the interests of Portugal and thus the cry of "Arrail for Portugal" and with the help of the great promoter of Lisboa Alvaro Pais who provoked patriotism in the same city was decisive for the future of this campaign, with Juan supported by the great and talented general Nuno Alvarez Pereira, he ended up obtaining support in cities such as Portoalegre, Estremoz and Beja where the population would take the respective castles from them.
The armed resistance would meet with Castilian troops, because of this Juan dedicated himself to obtain the support of the English because Castile had the support of France, so Richard II of England and John of Ghent Regent of England agreed to the sending of troops. At the end of 1384, Nuno Alvarez Pereira tried to take all the cities in favor of the Crown of Castile, achieving it in most cases.
In 1385 the battle of Aljubarrota would be developed where 5900 Portuguese and 100 English would fight against 28000 Castilians and 2000 French, where the result would be a massacre of the Castilian army, with this victory Juan de Avis was crowned king of Portugal, although Castilla would not recognize this until 1411.