The land within the borders of today's Portuguese Republic has been continuously settled since prehistoric times. Some of the earliest civilizations include Lusitanians and Celtic societies. Incorporation into the Roman Republic dominions took place in the 2nd century BC. The region was ruled and colonized by Germanic peoples, such as the Suebi and the Visigoths, from the 5th to the 8th century. From this era, some vestiges of the Alans were also found. The Muslim Moors arrived in the early 8th century and conquered the ChristianGermanic kingdoms, eventually occupying most of the Iberian Peninsula. In the early 12th century, during the Christian Reconquista, Portugal appeared as a kingdom independent of its neighbour, the Kingdom of León and Galicia. In a little over a century, in 1249, Portugal would establish almost its entire modern-day borders.
During the 15th and 16th centuries, with a global empire that included possessions in Africa, Asia and South America, Portugal was one of the world's major economic, political, and cultural powers. In the 17th century, the Portuguese Restoration War between Portugal and Spain ended the sixty-year period of the Iberian Union (1580–1640). In the 19th century, armed conflict with French and Spanish invading forces and the loss of its largest territorial possession abroad, Brazil, disrupted political stability and potential economic growth. In 1910, the last Portuguese king was overthrown and a republic was proclaimed. In 1926, a coup d'état established a military dictatorship that would be replaced by a fascist regime called Estado Novo in 1933. After the Portuguese Colonial War (1961–1974) and the Carnation Revolutioncoup d'état in 1974, the ruling regime was deposed in Lisbon, a democracy was established and the country handed over its last overseas provinces in Africa. Portugal was accepted as a member of the European Economic Community in 1986. Portugal's last overseas territory, Macau, was handed over to China in 1999.