Portugal is the oldest continuously existing nation state on the Iberian Peninsula and one of the oldest in Europe, its territory having been continuously settled, invaded and fought over since prehistoric times. It was inhabited by pre-Celtic and Celtic peoples who had contact with Phoenicians and Ancient Greek traders, it was ruled by the Romans, followed by the invasions of the Suebi and Visigothic Germanic peoples, in turn followed by the Moors who eventually were expelled. Portugal as a country was established during the early Christian Reconquista. Founded in 868, the County of Portugal gained prominence after the Battle of São Mamede (1128). The Kingdom of Portugal was later proclaimed following the Battle of Ourique (1139), and independence from León was recognized by the Treaty of Zamora (1143).
In the 15th and 16th centuries, Portugal established the first global maritime and commercial empire, becoming one of the world's major economic, political and military powers. During this period, today referred to as the Age of Discovery, Portuguese explorers pioneered maritime exploration with the discovery of what would become Brazil (1500). During this time Portugal monopolized the spice trade, divided the world into hemispheres of dominion with Castile, and the empire expanded with military campaigns in Asia. By the 18th century however, events such as the 1755 Lisbon earthquake, the country's occupation during the Napoleonic Wars, and the independence of Brazil (1822) led to a marked decay of Portugal's prior opulence. This was followed by the civil war between liberal constitutionalists and conservative absolutists over royal succession, which lasted from 1828 to 1834.
The 1910 revolution deposed Portugal's centuries-old monarchy, and established the democratic but unstable Portuguese First Republic, later being superseded by the Estado Novo authoritarian regime. Democracy was restored after the Carnation Revolution (1974), ending the Portuguese Colonial War. Shortly after, independence was granted to almost all its overseas territories. The handover of Macau to China (1999) marked the end of what can be considered one of the longest-lived colonial empires in history.
Portugal has left a profound cultural, architectural and linguistic influence across the globe, with a legacy of around 250 million Portuguese speakers around the world. It is a developed country with an advanced economy and high living standards. Additionally, it ranks highly in peacefulness, democracy, press freedom, stability, social progress, prosperity and English proficiency. A member of the United Nations, the European Union, the Schengen Area and the Council of Europe (CoE), Portugal was also one of the founding members of NATO, the eurozone, the OECD, and the Community of Portuguese Language Countries.