History of Portugal (1640–1777) put to the test in 1762 when Spain invaded aided by France, during the Seven Years' War. Britain invoked its alliance with Portugal and sent troops. Several months later, the conflict was settled with comparatively little fighting. In 1777, Spain and Portugal signed the Treaty of San Ildefonso, which mainly resolved a number of border disputes between their South American colonies. During the Age of Enlightenment, Portugal was considered one of Europe's unenlightened backwaters; it was a country of three million with 200,000 people in 538 monasteries in 1750. Melo seems to have been deeply embarrassed by Portugal's much lamented
Border of Granada other municipalities in the Huelva province, which include ""de la Frontera"" in their names. However, these do not refer to the Border of Granada border, but to the border with Portugal. This is the case with Rosal de la Frontera and Palos de la Frontera. The first frontier was defined by the Pact of Jaén in 1246 between Muhammad I "ibn al-Ahmar", first king of Granada, and King Fernando III 'El Santo', following extensive conquests by the latter in the valley of the Guadalquivir. The border then went through modifications during the reigns of Sancho IV, Fernando IV and Alfonso