The history of Portugal can be traced from circa 400,000 years ago, when the region of present-day Portugal was inhabited by Homo heidelbergensis.

The Roman conquest of the Iberian Peninsula, which lasted almost two centuries, led to the establishment of the provinces of Lusitania in the south and Gallaecia in the north of what is now Portugal. Following the fall of Rome, Germanic tribes controlled the territory between the 5th and 8th centuries, including the Kingdom of the Suebi centred on Braga and the Visigothic Kingdom in the south.

The 711–716 invasion by the Islamic Umayyad Caliphate conquered the Visigoth Kingdom and founded the Islamic State of Al-Andalus, gradually advancing through Iberia. In 1095, Portugal broke away from the Kingdom of Galicia. Afonso Henriques, son of the count Henry of Burgundy, proclaimed himself king of Portugal in 1139. The Algarve (the southernmost province of Portugal) was conquered from the Moors in 1249, and in 1255 Lisbon became the capital. Portugal's land boundaries have remained almost unchanged since then. During the reign of King John I, the Portuguese defeated the Castilians in a war over the throne (1385) and established a political alliance with England (by the Treaty of Windsor in 1386), the longest-lasting diplomatic treaty in recorded history.

From the late Middle Ages, in the 15th and 16th centuries, Portugal ascended to the status of a world power during Europe's "Age of Discovery" as it built up a vast empire. Signs of military decline began with the Battle of Alcácer Quibir in Morocco in 1578; this defeat led to the death of King Sebastian and the imprisonment of much of the high nobility, which had to be ransomed at great cost. This eventually led to a small interruption in Portugal's 800-year-old independence by way of a 60-year dynastic union with Spain between 1580 and the beginning of the Portuguese Restoration War led by John IV in 1640. Spain's disastrous defeat in its attempt to conquer England in 1588 by means of the Invincible Armada was also a factor, as Portugal had to contribute ships for the invasion. Further setbacks included the destruction of much of its capital city in an earthquake in 1755, occupation during the Napoleonic Wars, and the loss of its largest colony, Brazil, in 1822. From the middle of the 19th century to the late 1950s, nearly two million Portuguese left Portugal to live in Brazil and the United States.

In 1910, a revolution deposed the monarchy. A military coup in 1926 installed a dictatorship that remained until another coup in 1974. The new government instituted sweeping democratic reforms and granted independence to all of Portugal's African colonies in 1975. Portugal is a founding member of NATO, the Organisation for Economic Co-operation and Development (OECD), the European Free Trade Association (EFTA), and the Community of Portuguese Language Countries. It entered the European Economic Community (now the European Union) in 1986.

Etymology The word Portugal derives from the combined Roman-Celtic place name Portus Cale; a settlement where present-day's conurbation of Porto and Vila Nova de Gaia (or simply, Gaia) stand, along the banks of river Douro in the north of what is now Portugal.

Porto stems from the Latin word for port or harbour, , with the second element Cales meaning and precise origin being less clear. The mainstream explanation points to an ethnonym derived from the Callaeci also known as the Gallaeci peoples, who occupied the north-west of the Iberian Peninsula. The names Cale and Callaici are the origin of today's Gaia and Galicia. Another theory proposes that Cale or Calle is a derivation of the Celtic word for 'port', like the Irish or Scottish Gaelic . These explanations, would require the pre-Roman language of the area to have been a branch of Q-Celtic, which is not generally accepted because the region's pre-Roman language was Gallaecian. However, scholars like Jean Markale and Tranoy propose the Celtic branches all share the same origin, and placenames such as Cale, Gal, Gaia, Calais, Galatia, Galicia, Gaelic, Gael, Gaul (), Wales, Cornwall, Wallonia and others all stem from one linguistic root. Cala is sometimes considered not Celtic, but from Late Latin calatum > calad > cala,Alexander Macbain, An etymological dictionary of the Gaelic language, Gairm Publications; 1982 (new edition), p. 66. compare Italian , French , itself from Occitan cala "cove, small harbour" from a Pre-Indo-European root *kal / *cala (see calanque and maybe Galici-a < Callaeci or Calaeci). Another theory claims it derives from the word Caladunum, in fact an unattested compound *Caladunum, that may explain the toponym Calezun in Gascony.Jacques Lacroix (preface Venceslas Kruta), Les Noms d'origine gauloise (NE): La Gaule des combats, Editions Errance, 2012, p. 134

A further explanation proposes Gatelo as having been the origin of present-day Braga, Santiago de Compostela, and consequently the wider regions of Northern Portugal and Galicia. A different theory has it that Cala was the name of a Celtic goddess (drawing a comparison with the Gaelic Cailleach, a supernatural hag). Some French scholars believe the name may have come from , the port of the Gauls or Celts.

Around 200 BC, the Romans took the Iberian Peninsula from the Carthaginians during the Second Punic War. In the process they conquered Cale, renaming it ('Port of Cale') and incorporating it in the province of Gaellicia with its capital in Bracara Augusta (modern day Braga, Portugal). During the Middle Ages, the region around Portus Cale became known by the Suebi and Visigoths as Portucale. The name Portucale changed into Portugale during the 7th and 8th centuries. By the 9th century, Portugale was used extensively to refer to the region between the rivers Douro and Minho, the Minho flowing along what would become the northern Portugal–Spain border. By the 11th and 12th centuries, Portugale, Portugallia, Portvgallo or Portvgalliae was already referred to as Portugal.

The 14th-century Middle French name for the country, , which added an intrusive /n/ sound through the process of excrescence, spread to Middle English."Portugal, n. and adj." OED Online, Oxford University Press, June 2020, www.oed.com/view/Entry/148257. Accessed 30 July 2020. Middle English variant spellings included , , and .Hans Kurath. "Portingāl(e" Middle English Dictionary. University of Michigan Press, 1954. p. 1131. The spelling is found in Chaucer's Epilogue to the Nun's Priest's Tale. These variants survive in the Torrent of Portyngale, a Middle English romance composed around 1400, and "Old Robin of Portingale", an English Child ballad. and variants were also used in Scots and survive in the Cornish name for the country, Portyngal.

Early history

The early history of Portugal is shared with the rest of the Iberian Peninsula located in southwestern Europe. The name of Portugal derives from the joined Romano-Celtic name Portus Cale. The region was settled by Pre-Celts and Celts, giving origin to peoples like the Gallaeci, Lusitanians, Celtici and Cynetes (also known as Conii). Some coastal areas were visited by Phoenicians-Carthaginians and Ancient Greeks. It was incorporated in the Roman Republic dominions as Lusitania and part of Gallaecia, after 45 BC until 298 AD.

Prehistory

The region of present-day Portugal was inhabited by humans since circa 400,000 years ago, when Homo heidelbergensis entered the area. The oldest human fossil found in Portugal is the 400,000-year-old Aroeira 3 H. Heidelbergensis skull discovered in the Cave of Aroeira in 2014. Later Neanderthals roamed the northern Iberian peninsula and a tooth has been found at Nova da Columbeira cave in Estremadura. Homo sapiens sapiens arrived in Portugal around 35,000 years ago, spreading and roaming the border-less region of the northern Iberian peninsula.David Birmingham (2003), p. 11 These were subsistence societies and although they did not establish prosperous settlements, they did form organized societies. Neolithic Portugal experimented with domestication of herding animals, the raising of some cereal crops and fluvial or marine fishing.

Pre-Celtic tribes inhabited Portugal leaving a cultural footprint. The Cynetes developed a written language, leaving many stelae, which are mainly found in the south of Portugal. Early in the first millennium BC, waves of Celts invaded Portugal from Central Europe and inter-married with the local populations, forming different tribes. Another theory suggests that Celts inhabited western Iberia / Portugal well before any large Celtic migrations from Central Europe. A number of linguists expert in ancient Celtic have presented compelling evidence that the Tartessian language, once spoken in parts of SW Spain and SW Portugal, is at least proto-Celtic in structure.

The Celtic presence in Portugal is traceable, in broad outline, through archaeological and linguistic evidence. They dominated much of northern and central Portugal; but in the south, they were unable to establish their stronghold, which retained its non-Indo-European character until the Roman conquest. In southern Portugal, some small, semi-permanent commercial coastal settlements were also founded by Phoenician-Carthaginians.

Modern archaeology and research shows a Portuguese root to the Celts in Portugal and elsewhere. During that period and until the Roman invasions, the Castro culture (a variation of the Urnfield culture also known as Urnenfelderkultur) was prolific in Portugal and modern Galicia.Estos se establecieron en el norte de Portugal y el área de la Galicia actual, introduciendo en esta región la cultura de las urnas, una variante de las Urnenfelder que evolucionaría después en la cultura de los castros o castreña This culture, together with the surviving elements of the Atlantic megalithic culture and the contributions that come from the more Western Mediterranean cultures, ended up in what has been called the Cultura Castreja or Castro Culture. This designation refers to the characteristic Celtic populations called 'dùn', 'dùin' or 'don' in Gaelic and that the Romans called castrae in their chronicles.

Based on the Roman chronicles about the Callaeci peoples, along with the Lebor Gabála Érenn narrations and the interpretation of the archaeological remains throughout the northern half of Portugal and Galicia, it is possible to infer that there was a matriarchal society, with a military and religious aristocracy probably of the feudal type. The figures of maximum authority were the chieftain (chefe tribal), of military type and with authority in his Castro or clan, and the druid, mainly referring to medical and religious functions that could be common to several castros. The Celtic cosmogony remained homogeneous due to the ability of the druids to meet in councils with the druids of other areas, which ensured the transmission of knowledge and the most significant events.

The first documentary references to Castro society are provided by chroniclers of Roman military campaigns such as Strabo, Herodotus and Pliny the Elder among others, about the social organization, and describing the inhabitants of these territories, the Gallaeci of Northern Portugal as: "A group of barbarians who spend the day fighting and the night eating, drinking and dancing under the moon."