Portugal, officially the Portuguese Republic, is a country on the Iberian Peninsula in Southwestern Europe. It is an unitary semi-presidential republic composed by continental Portugal and two autonomous regions, with Lisbon as both its capital and largest city. The continental portion borders Spain to the north and east, with Madeira and the Azores in the Atlantic Ocean. It features the westernmost point in continental Europe.
The western Iberian Peninsula has been continuously inhabited since prehistoric times, with the earliest signs of settlement dating to 5500 BC. Celtic and Iberian peoples arrived in the first millennium BC. The region came under Roman control in the second century BC. A succession of Germanic peoples and the Alans ruled from the fifth to eighth centuries AD. Muslims invaded mainland Portugal in the eighth century, but were gradually expelled by the Christian Reconquista, culminating with the capture of the Algarve between 1238 and 1249. Modern Portugal began taking shape during this period, initially as a county of the Christian Kingdom of León in 868, and formally as a sovereign kingdom with the Manifestis Probatum in 1179.