The city of Silves, conquered by King Sancho I of Portugal the previous year, was besieged by a Muslim army, but the Portuguese resisted the attack.
In 1188, the Almohad caliph Yaqub al-Mansur completed the conquest of the entire Maghreb, declared holy war and warned the inhabitants of al-Andalus that he was preparing to cross the Strait of Gibraltar and set out to conquer the Christian kingdoms of the peninsula.
[1] In Córdoba, al-Mansur received ambassadors from the king of Castile and signed a truce with him, thus leaving him free to focus on the conquest of Portugal.
[2][3] The English reinforcements were part of Richard the Lionheart's armada, which had dispersed off the Iberian Peninsula on its way to the Holy Land due to bad weather.
[1] Faced with a lack of supplies, tenacious resistance in Tomar and Santarém, and an outbreak of dysentery among his army, the caliph ordered all his troops to withdraw from Portugal.