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
Portugal and occupation. On 26 March 1995, Portugal started to implement Schengen Area rules, eliminating border controls with other Schengen members while simultaneously strengthening border controls with non-member states. In 1996 the country was a co-founder of the Community of Portuguese Language Countries (CPLP) headquartered in Lisbon. Expo '98 took place in Portugal and in 1999 it was one of the founding countries of the euro and the eurozone. On 5 July 2004, José Manuel Barroso, then Prime Minister of Portugal, was nominated President of the European Commission, the most powerful office in the European Union. On 1 December 2009, the