History

Pre-Celts and Celts

The early history of Portugal is shared with the rest of the Iberian Peninsula located in South Western 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, visited by Phoenicians, Ancient Greeks and Carthaginians, incorporated in the Roman Republic dominions as Lusitania and part of Gallaecia, after 45 BC until 298 AD.

The region of present-day Portugal was inhabited by Neanderthals and then by Homo sapiens, who roamed the border-less region of the northern Iberian peninsula. These were subsistence societies that, although they did not establish prosperous settlements, did form organized societies. Neolithic Portugal experimented with domestication of herding animals, the raising of some cereal crops and fluvial or marine fishing.

It was believed by some scholars that early in the first millennium BC, several waves of Celts invaded Portugal from Central Europe and inter-married with the local populations, forming different tribes. Modern archeology and research shows a Portuguese root to the Celts in Portugal and elsewhere.

Chief among these tribes were the Lusitanians, with the core area of these people lying in inland central Portugal, other related tribes existed such as the Gallaeci of Northern Portugal, the Celtici of Alentejo, and the Cynetes or Conii of the Algarve. Among the lesser tribes or sub-divisions were the Bracari, Coelerni, Equaesi, Grovii, Interamici, Leuni, Luanqui, Limici, Narbasi, Nemetati, Paesuri, Quaquerni, Seurbi, Tamagani, Tapoli, Turduli, Turduli Veteres, Turdulorum Oppida, Turodi, and Zoelae. A few small, semi-permanent, commercial coastal settlements (such as Tavira) were also founded in the Algarve region by Phoenicians-Carthaginians.

Roman Lusitania and Gallaecia

Romans first invaded the Iberian Peninsula in 219 BC. The Carthaginians, Rome's adversary in the Punic Wars, were expelled from their coastal colonies. During the last days of Julius Caesar, almost the entire peninsula was annexed to the Roman Republic.

The Roman conquest of what is now part of Portugal took almost two hundred years and took many lives of young soldiers and the lives of those who were sentenced to a certain death in the slavery mines when not sold as slaves to other parts of the empire. It suffered a severe setback in 150 BC, when a rebellion began in the north. The Lusitanians and other native tribes, under the leadership of Viriathus, wrested control of all of western Iberia.

Rome sent numerous legions and its best generals to Lusitania to quell the rebellion, but to no avail—the Lusitanians kept conquering territory. The Roman leaders decided to change their strategy. They bribed Viriathus's allies to kill him. In 139 BC, Viriathus was assassinated, and Tautalus became leader.

Rome installed a colonial regime. The complete Romanization of Lusitania only took place in the Visigothic era.

In 27 BC, Lusitania gained the status of Roman province. Later, a northern province of Lusitania was formed, known as Gallaecia, with capital in Bracara Augusta, today's Braga. There are still many ruins of castros (hill forts) all over modern Portugal and remains of Castro culture. Numerous Roman sites are scattered around present-day Portugal, some urban remains are quite large, like Conímbriga and Mirobriga. The former, beyond being one of the largest Roman settlements in Portugal, is also classified as a National Monument. Conímbriga lies 16 kilometres (9.9 miles) from Coimbra which by its turn was the ancient Aeminium). The site also has a museum that displays objects found by archaeologists during their excavations.

Several works of engineering, such as baths, temples, bridges, roads, circus, theatres and layman's homes are preserved throughout the country. Coins, some of which coined in Lusitanian land, as well as numerous pieces of ceramics were also found. Contemporary historians include Paulus Orosius (c. 375–418) and Hydatius (c. 400–469), bishop of Aquae Flaviae, who reported on the final years of the Roman rule and arrival of the Germanic tribes.

Germanic kingdoms: Suebi and Visigoths

In the early 5th century, Germanic tribes, namely the Suebi and the Vandals (Silingi and Hasdingi) together with their allies, the Sarmatians and Alans invaded the Iberian Peninsula where they would form their kingdom. The Kingdom of the Suebi was the Germanic post-Roman kingdom, established in the former Roman provinces of Gallaecia-Lusitania. 5th-century vestiges of Alan settlements were found in Alenquer (from old Germanic Alan kerk, temple of the Alans), Coimbra and Lisbon.

About 410 and during the 6th century it became a formally declared kingdom, where king Hermeric made a peace treaty with the Gallaecians before passing his domains to Rechila, his son. In 448 Réchila died, leaving the state in expansion to Rechiar.

In the year 500, the Visigothic Kingdom was installed in Iberia, centered on Toledo. The Visigoths eventually conquered the Suebi and its capital city Bracara (modern day Portugal's Braga) in 584–585, following the consecutive defeats of the two last Suebi kings Audeca and Malaric. The former Kingdom of the Suebi then became the sixth province of the Visigothic Kingdom of Hispania.

For the next 300 years and by the year 700, the entire Iberian Peninsula was ruled by the Visigoths. This period lasted until 711, when King Roderic (Rodrigo) was killed while opposing a Moorish invasion from the south. From the various Germanic groups who settled in Western Iberia, the Suebi left the strongest lasting cultural legacy in what is today Portugal, Galicia and Asturias.

Islamic period and the Reconquista

Today's modern day continental Portugal, along with most of modern Spain, was part of al-Andalus between 711 AD – 1249 AD, following the Umayyad Caliphate conquest of the Iberian Peninsula in 711 AD. This occupation lasted from some decades in the North to more than five centuries in the South.

After defeating the Visigoths in only a few months, the Umayyad Caliphate started expanding rapidly in the peninsula. Beginning in 711, the land that is now Portugal became part of the vast Umayyad Caliphate's empire of Damascus, which stretched from the Indus river in the Indian sub-continent (now Pakistan) up to the South of France, until its collapse in 750. That year the west of the empire gained its independence under Abd-ar-Rahman I with the establishment of the Emirate of Córdoba. After almost two centuries, the Emirate became the Caliphate of Córdoba in 929, until its dissolution a century later in 1031 into no less than 23 small kingdoms, called Taifa kingdoms.

The governors of the taifas each proclaimed themselves Emir of their provinces and established diplomatic relations with the Christian kingdoms of the north. Most of Portugal fell into the hands of the Taifa of Badajoz of the Aftasid Dynasty, and after a short spell of an ephemeral Taifa of Lisbon in 1022, fell under the dominion of the Taifa of Seville of the Abbadids poets. The Taifa period ended with the conquest of the Almoravids who came from Morocco in 1086 winning a decisive victory at the Battle of Sagrajas, followed a century later in 1147, after the second period of Taifa, by the Almohads, also from Marrakesh.

Al-Andalus was divided into different districts called Kura. Gharb Al-Andalus at its largest was constituted of ten kuras, each with a distinct capital and governor. The main cities of the period in Portugal were Beja, Silves, Alcácer do Sal, Santarém and Lisbon.

The Muslim population of the region consisted mainly of native Iberian converts to Islam (the so-called Muwallad or Muladi) and berbers. The Arabs were principally noblemen from Syria and Oman; and though few in numbers, they constituted the elite of the population. The Berbers were originally from the Atlas mountains and Rif mountains of North Africa and were essentially nomads.

County of Portucale

An Asturian Visigothic noble named Pelagius of Asturias in 718 AD was elected leader by many of the ousted Visigoth nobles. Pelagius called for the remnant of the Christian Visigothic armies to rebel against the Moors and regroup in the unconquered northern Asturian highlands, better known today as the Cantabrian Mountains, in what is today the small mountain region in North-western Spain, adjacent to the Bay of Biscay.

Pelagius' plan was to use the Cantabrian mountains as a place of refuge and protection from the invading Moors. He then aimed to regroup the Iberian Peninsula's Christian armies and use the Cantabrian mountains as a springboard from which to regain their lands. In the process, after defeating the Moors in the Battle of Covadonga in 722 AD, Pelagius was proclaimed king, thus founding the Christian Kingdom of Asturias and starting the war of Christian reconquest known in Portuguese as the Reconquista Cristã.

At the end of the 9th century, the region of Portugal, between the rivers Minho and Douro, was freed or reconquered from the Moors by Vímara Peres on the orders of King Alfonso III of Asturias. Finding that the region had previously had two major cities—Portus Cale in the coast and Braga in the interior, with many towns that were now deserted—he decided to repopulate and rebuild them with Portuguese and Galician refugees and other Christians.

Vímara Peres organized the region he freed from the Moors, and elevated it to the status of County, naming it the County of Portugal after the region's major port city—Portus Cale' or modern Porto. One of the first cities Vimara Peres founded at this time is Vimaranes, known today as Guimarães – the "birthplace of the Portuguese nation" or the "cradle city" (Cidade Berço in Portuguese).

After annexing the County of Portugal into one of the several counties that made up the Kingdom of Asturias, King Alfonso III of Asturias knighted Vímara Peres, in 868 AD, as the First Count of Portus Cale (Portugal). The region became known as Portucale, Portugale, and simultaneously Portugália — the County of Portugal.

Later the Kingdom of Asturias was divided into a number of Christian Kingdoms in Northern Iberia due to dynastic divisions of inheritance among the king's offspring. With the forced abdication of Alfonso III "the Great" of Asturias by his sons in 910, the Kingdom of Asturias split into three separate kingdoms of León, Galicia and Asturias. The three kingdoms were eventually reunited in 924 (León and Galicia in 914, Asturias later) under the crown of León.

During the century of internecine struggles for dominance among the Northern Christians kingdoms, the County of Portugal formed the southern portion of the Kingdom of Galicia. At times the Kingdom of Galicia existed independently for short periods, but usually formed an important part of the Kingdom of León. Throughout this period, the people of County of Portugal as Galicians found themselves struggling to maintain the autonomy of Galicia with its distinct language and culture (Galician-Portuguese) from the Leonese culture, whenever the status of the Kingdom of Galicia changed in relation to the Kingdom of León. As a result of political division, Galician-Portuguese lost its unity when the County of Portugal separated from the Kingdom of Galicia (a dependent kingdom of León) to establish the Kingdom of Portugal.

In 1093, Alfonso VI of León and Castile bestowed the county to Henry of Burgundy and married him to his daughter, Teresa of León, for his role in reconquering the land from Moors. Henry based his newly formed county in Bracara Augusta (modern Braga), capital city of the ancient Roman province, and also previous capital of several kingdoms over the first millennia.

Independence and Afonsine era

On 24 June 1128, the Battle of São Mamede occurred near Guimarães. Afonso Henriques, Count of Portugal, defeated his mother Countess Teresa and her lover Fernão Peres de Trava, thereby establishing himself as sole leader. Afonso then turned his arms against the Moors in the south.

Afonso's campaigns were successful and, on 25 July 1139, he obtained an overwhelming victory in the Battle of Ourique, and straight after was unanimously proclaimed King of Portugal by his soldiers. This is traditionally taken as the occasion when the County of Portugal, as a fief of the Kingdom of León, was transformed into the independent Kingdom of Portugal.

Afonso then established the first of the Portuguese Cortes at Lamego, where he was crowned by the Archbishop of Braga, though the validity of the Cortes of Lamego has been disputed and called a myth created during the Portuguese Restoration War. Afonso was recognized in 1143 by King Alfonso VII of León, and in 1179 by Pope Alexander III.

During the Reconquista period, Christians reconquered the Iberian Peninsula from Moorish domination. Afonso Henriques and his successors, aided by military monastic orders, pushed southward to drive out the Moors. At this time Portugal covered about half of its present area. In 1249, the Reconquista ended with the capture of the Algarve and complete expulsion of the last Moorish settlements on the southern coast, giving Portugal its present-day borders, with minor exceptions.

In one of these situations of conflict with the kingdom of Castile, Dinis I of Portugal signed with the king Fernando IV of Castile (which was represented, when being a minor, by his mother the queen Maria de Molina) the Treaty of Alcañices (1297), which stipulated that Portugal abolished agreed treaties against the kingdom of Castile for supporting the infant Juan de Castilla. This treaty established inter alia the border demarcation between the kingdom of Portugal and the kingdom of Leon, where the disputed town of Olivenza was included.

The reigns of Dinis I (Denis I), Afonso IV (Alphons IV), and Pedro I (Peter I) for the most part saw peace with the Christian kingdoms of Iberia.

In 1348 and 1349 Portugal, like the rest of Europe, was devastated by the Black Death. In 1373, Portugal made an alliance with England, which is the longest-standing alliance in the world. Over time this went way beyond geo-political and military cooperation (protecting both nations' interests in Africa, the Americas and Asia against French, Spanish and Dutch rivals) and maintained strong trade and cultural ties between the two old European allies. Particularly in the Oporto region, there is visible English influence to this day.

Joanine era and Age of Discoveries

In 1383, John I of Castile, husband of Beatrice of Portugal and son-in-law of Ferdinand I of Portugal, claimed the throne of Portugal. A faction of petty noblemen and commoners, led by John of Aviz (later King John I of Portugal) and commanded by General Nuno Álvares Pereira defeated the Castilians in the Battle of Aljubarrota. With this battle, the House of Aviz became the ruling house of Portugal.

Portugal spearheaded European exploration of the world and the Age of Discovery. Prince Henry the Navigator, son of King João I, became the main sponsor and patron of this endeavour. During this period, Portugal explored the Atlantic Ocean, discovering several Atlantic archipelagos like the Azores, Madeira, and Cape Verde, explored the African coast, colonized selected areas of Africa, discovered an eastern route to India via the Cape of Good Hope, discovered Brazil, explored the Indian Ocean, established trading routes throughout most of southern Asia, and sent the first direct European maritime trade and diplomatic missions to China and Japan.

In 1415, Portugal acquired the first of its overseas colonies by conquering Ceuta, the first prosperous Islamic trade centre in North Africa. There followed the first discoveries in the Atlantic: Madeira and the Azores, which led to the first colonization movements.

Throughout the 15th century, Portuguese explorers sailed the coast of Africa, establishing trading posts for several common types of tradable commodities at the time, ranging from gold to slaves, as they looked for a route to India and its spices, which were coveted in Europe.

The Treaty of Tordesillas, intended to resolve the dispute that had been created following the return of Christopher Columbus, which was made by Pope Alexander VI, the mediator between Portugal and Spain. It was signed on 7 June 1494, and divided the newly discovered lands outside Europe between the two countries along a meridian 370 leagues west of the Cape Verde islands (off the west coast of Africa).

In 1498, Vasco da Gama reached India and brought economic prosperity to Portugal and its population of 1.7 million residents, helping to start the Portuguese Renaissance. In 1500, the Portuguese explorer Gaspar Corte-Real reached what is now Canada and founded the town of Portugal Cove-St. Philip's, Newfoundland and Labrador, long before the French and English in the 17th century, and being just one of many Portuguese Colonizations of the Americas.

In 1500, Pedro Álvares Cabral discovered Brazil and claimed it for Portugal. Ten years later, Afonso de Albuquerque conquered Goa in India, Muscat and Ormuz in the Persian Strait, and Malacca, now a state in Malaysia. Thus, the Portuguese empire held dominion over commerce in the Indian Ocean and South Atlantic. Portuguese sailors set out to reach Eastern Asia by sailing eastward from Europe, landing in such places as Taiwan, Japan, the island of Timor, and in the Moluccas.

Although for a long period it was believed the Dutch were the first Europeans to arrive in Australia, there is also some evidence that the Portuguese may have discovered Australia in 1521.

The Treaty of Zaragoza, signed on 22 April 1529 between Portugal and Spain, specified the anti-meridian to the line of demarcation specified in the Treaty of Tordesillas.

All these factors made Portugal one of the world's major economic, military, and political powers from the 15th century until the late 16th century.

Iberian Union, Restoration and early Brigantine era

Portugal's sovereignty was interrupted between 1580 and 1640. This occurred because the last two kings of the House of Aviz – King Sebastian, who died in the battle of Alcácer Quibir in Morocco, and his great-uncle and successor, King Henry of Portugal – both died without heirs, resulting in the Portuguese succession crisis of 1580.

Subsequently, Philip II of Spain claimed the throne and so became Philip I of Portugal. Although Portugal did not lose its formal independence, it was governed by the same monarch who governed the Spanish Empire, briefly forming a union of kingdoms. At this time Spain was a geographic territory. The joining of the two crowns deprived Portugal of an independent foreign policy and led to its involvement in the Eighty Years' War between Spain and the Netherlands.

War led to a deterioration of the relations with Portugal's oldest ally, England, and the loss of Hormuz, a strategic trading post located between Iran and Oman. From 1595 to 1663 the Dutch-Portuguese War primarily involved the Dutch companies invading many Portuguese colonies and commercial interests in Brazil, Africa, India and the Far East, resulting in the loss of the Portuguese Indian sea trade monopoly.

In 1640, John IV spearheaded an uprising backed by disgruntled nobles and was proclaimed king. The Portuguese Restoration War between Portugal and the Spanish Empire, in the aftermath of the 1640 revolt, ended the sixty-year period of the Iberian Union under the House of Habsburg. This was the beginning of the House of Braganza, which reigned in Portugal until 1910.

King John IV's eldest son came to reign as Afonso VI, however his physical and mental disabilities left him overpowered by Luís de Vasconcelos e Sousa, 3rd Count of Castelo Melhor. In a palace coup organized by the King's wife, Maria Francisca of Savoy, and his brother, Pedro, Duke of Beja, King Afonso VI was declared mentally incompetent and exiled first to the Azores and then to the Royal Palace of Sintra, outside Lisbon. After Afonso's death, Pedro came to the throne as King Pedro II. Pedro's reign saw the consolidation of national independence, imperial expansion, and investment in domestic production.

Pedro II's son, John V, saw a reign characterized by the influx of gold into the coffers of the royal treasury, supplied largely by the royal fifth (a tax on precious metals) that was received from the Portuguese colonies of Brazil and Maranhão. Acting as an absolute monarch, John nearly depleted his country's tax revenues on ambitious architectural works, most notably Mafra Palace, and on commissions and additions for his sizable art and literary collections.

Official estimates – and most estimates made so far – place the number of Portuguese migrants to Colonial Brazil during the gold rush of the 18th century at 600,000. This represented one of the largest movements of European populations to their colonies in the Americas during colonial times.

Pombaline era and Enlightenment

In 1738, Sebastião José de Carvalho e Melo, 1st Marquis of Pombal, began a diplomatic career as the Portuguese Ambassador in London and later in Vienna. The Queen consort of Portugal, Archduchess Maria Anne Josefa of Austria, was fond of Melo; and after his first wife died, she arranged the widowed de Melo's second marriage to the daughter of the Austrian Field Marshal Leopold Josef, Count von Daun. King John V of Portugal, however, was not pleased and recalled Melo to Portugal in 1749. John V died the following year and his son, Joseph I of Portugal, was crowned. In contrast to his father, Joseph I was fond of de Melo, and with the Queen Mother's approval, he appointed Melo as Minister of Foreign Affairs.

As the King's confidence in de Melo increased, the King entrusted him with more control of the state. By 1755, Sebastião de Melo was made Prime Minister. Impressed by British economic success that he had witnessed from the Ambassador, he successfully implemented similar economic policies in Portugal. He abolished slavery in Portugal and in the Portuguese colonies in India; reorganized the army and the navy; restructured the University of Coimbra, and ended discrimination against different Christian sects in Portugal.

But Sebastião de Melo's greatest reforms were economic and financial, with the creation of several companies and guilds to regulate every commercial activity. He demarcated the region for production of Port to ensure the wine's quality, and this was the first attempt to control wine quality and production in Europe. He ruled with a strong hand by imposing strict law upon all classes of Portuguese society from the high nobility to the poorest working class, along with a widespread review of the country's tax system. These reforms gained him enemies in the upper classes, especially among the high nobility, who despised him as a social upstart.

Disaster fell upon Portugal in the morning of 1 November 1755, when Lisbon was struck by a violent earthquake with an estimated moment magnitude of 8.5–9. The city was razed to the ground by the earthquake and the subsequent tsunami and ensuing fires. Sebastião de Melo survived by a stroke of luck and then immediately embarked on rebuilding the city, with his famous quote: "What now? We bury the dead and take care of the living."

Despite the calamity and huge death toll, Lisbon suffered no epidemics and within less than one year was already being rebuilt. The new city centre of Lisbon was designed to resist subsequent earthquakes. Architectural models were built for tests, and the effects of an earthquake were simulated by marching troops around the models. The buildings and big squares of the Pombaline City Centre still remain as one of Lisbon's tourist attractions. Sebastião de Melo also made an important contribution to the study of seismology by designing an inquiry that was sent to every parish in the country.

Following the earthquake, Joseph I gave his Prime Minister even more power, and Sebastião de Melo became a powerful, progressive dictator. As his power grew, his enemies increased in number, and bitter disputes with the high nobility became frequent. In 1758 Joseph I was wounded in an attempted assassination. The Távora family and the Duke of Aveiro were implicated and executed after a quick trial. The Jesuits were expelled from the country and their assets confiscated by the crown. Sebastião de Melo prosecuted every person involved, even women and children. This was the final stroke that broke the power of the aristocracy. Joseph I made his loyal minister Count of Oeiras in 1759.

In 1762, Spain invaded Portuguese territory as part of the Seven Years' War, but by 1763 the status quo between Spain and Portugal before the war had been restored.

Following the Távora affair, the new Count of Oeiras knew no opposition. Made "Marquis of Pombal" in 1770, he effectively ruled Portugal until Joseph I's death in 1779. However, historians also argue that Pombal’s "enlightenment," while far-reaching, was primarily a mechanism for enhancing autocracy at the expense of individual liberty and especially an apparatus for crushing opposition, suppressing criticism, and furthering colonial economic exploitation as well as intensifying book censorship and consolidating personal control and profit.

Napoleonic era

The new ruler, Queen Maria I of Portugal, disliked the Marquis because of the power he amassed, and never forgave him for the ruthlessness with which he dispatched the Távora family, and upon her accession to the throne, she withdrew all his political offices. Pombal died on his estate at Pombal in 1782.

In the autumn of 1807, Napoleon moved French troops through Spain to invade Portugal. From 1807 to 1811, British-Portuguese forces would successfully fight against the French invasion of Portugal, while the royal family and the Portuguese nobility, including Maria I, relocated to the Portuguese territory of Brazil, at that time a colony of the Portuguese Empire, in South America. This episode is known as the Transfer of the Portuguese Court to Brazil.

With the occupation by Napoleon, Portugal began a slow but inexorable decline that lasted until the 20th century. This decline was hastened by the independence in 1822 of the country's largest colonial possession, Brazil. In 1807, as Napoleon's army closed in on Lisbon, the Prince Regent João VI of Portugal transferred his court to Brazil and established Rio de Janeiro as the capital of the Portuguese Empire. In 1815, Brazil was declared a Kingdom and the Kingdom of Portugal was united with it, forming a pluricontinental State, the United Kingdom of Portugal, Brazil and the Algarves.

As a result of the change in its status and the arrival of the Portuguese royal family, Brazilian administrative, civic, economical, military, educational, and scientific apparatus were expanded and highly modernized. Portuguese and their allied British troops fought against the French Invasion of Portugal and by 1815 the situation in Europe had cooled down sufficiently that João VI would have been able to return safely to Lisbon. However, the King of Portugal remained in Brazil until the Liberal Revolution of 1820, which started in Porto, demanded his return to Lisbon in 1821.

Thus he returned to Portugal but left his son Pedro in charge of Brazil. When the Portuguese Government attempted the following year to return the Kingdom of Brazil to subordinate status, his son Pedro, with the overwhelming support of the Brazilian elites, declared Brazil's independence from Portugal. Cisplatina (today's sovereign state of Uruguay), in the south, was one of the last additions to the territory of Brazil under Portuguese rule.

Brazilian independence was recognized in 1825, whereby Emperor Pedro I granted to his father the titular honour of Emperor of Brazil. John VI's death in 1826 caused serious questions in his succession. Though Pedro was his heir, and reigned briefly as Pedro IV, his status as a Brazilian monarch was seen as an impediment to holding the Portuguese throne by both nations. Pedro abdicated in favour of his daughter, Maria II. However, Pedro's brother, Infante Miguel, claimed the throne in protest. After a proposal for Miguel and Maria to marry failed, Miguel seized power as King Miguel I, in 1828. In order to defend his daughter's rights to the throne, Pedro launched the Liberal Wars to reinstall his daughter and establish a constitutional monarchy in Portugal. The war ended in 1834, with Miguel's defeat, the promulgation of a constitution, and the reinstatement of Queen Maria II.

Constitutional monarchy

Queen Maria II and King Ferdinand II's son, King Pedro V modernized the country during his short reign (1853–1861). Under his reign, roads, telegraphs, and railways were constructed and improvements in public health advanced. His popularity increased when, during the cholera outbreak of 1853–1856, he visited hospitals handing out gifts and comforting the sick. Pedro's reign was short, as he died of cholera in 1861, after a series of deaths in the royal family, including his two brothers Infante Fernando and Infante João, Duke of Beja, and his wife, Stephanie of Hohenzollern-Sigmaringen. Not having children, his brother, Luís I of Portugal ascended the throne and continued his modernization.

At the height of European colonialism in the 19th century, Portugal had already lost its territory in South America and all but a few bases in Asia. Luanda, Benguela, Bissau, Lourenço Marques, Porto Amboim and the Island of Mozambique were among the oldest Portuguese-founded port cities in its African territories. During this phase, Portuguese colonialism focused on expanding its outposts in Africa into nation-sized territories to compete with other European powers there.

With the Conference of Berlin of 1884, Portuguese Africa territories had their borders formally established on request of Portugal in order to protect the centuries-long Portuguese interests in the continent from rivalries enticed by the Scramble for Africa. Portuguese Africa's cities and towns like Nova Lisboa, Sá da Bandeira, Silva Porto, Malanje, Tete, Vila Junqueiro, Vila Pery and Vila Cabral were founded or redeveloped inland during this period and beyond. New coastal towns like Beira, Moçâmedes, Lobito, João Belo, Nacala and Porto Amélia were also founded. Even before the turn of the 20th century, railway tracks as the Benguela railway in Angola, and the Beira railway in Mozambique, started to be built to link coastal areas and selected inland regions.

Other episodes during this period of the Portuguese presence in Africa include the 1890 British Ultimatum. This forced the Portuguese military to retreat from the land between the Portuguese colonies of Mozambique and Angola (most of present-day Zimbabwe and Zambia), which had been claimed by Portugal and included in its "Pink Map", which clashed with British aspirations to create a Cape to Cairo Railway.

The Portuguese territories in Africa were Cape Verde, São Tomé and Príncipe, Portuguese Guinea, Angola, and Mozambique. The tiny fortress of São João Baptista de Ajudá on the coast of Dahomey, was also under Portuguese rule. In addition, Portugal still ruled the Asian territories of Portuguese India, Portuguese Timor and Macau.

On 1 February 1908, the king Dom Carlos I of Portugal and his heir apparent, Prince Royal Dom Luís Filipe, Duke of Braganza, were murdered in Lisbon. Under his rule, Portugal had twice been declared bankrupt – on 14 June 1892, and again on 10 May 1902 – causing social turmoil, economic disturbances, protests, revolts and criticism of the monarchy. Manuel II of Portugal became the new king, but was eventually overthrown by the 5 October 1910 revolution, which abolished the regime and instated republicanism in Portugal.

First Republic and Estado Novo

Political instability and economic weaknesses were fertile ground for chaos and unrest during the Portuguese First Republic. These conditions would lead to the failed Monarchy of the North, 28 May 1926 coup d'état, and the creation of the National Dictatorship (Ditadura Nacional). This in turn led to the establishment of the right-wing dictatorship of the Estado Novo under António de Oliveira Salazar in 1933.

Portugal was one of only five European countries to remain neutral in World War II. From the 1940s to the 1960s, Portugal was a founding member of NATO, OECD and the European Free Trade Association (EFTA). Gradually, new economic development projects and relocation of mainland Portuguese citizens into the overseas provinces in Africa were initiated, with Angola and Mozambique, as the largest and richest overseas territories, being the main targets of those initiatives. These actions were used to affirm Portugal's status as a transcontinental nation and not as a colonial empire.

After India attained independence in 1947, pro-Indian residents of Dadra and Nagar Haveli, with the support of the Indian government and the help of pro-independence organisations, separated the territories of Dadra and Nagar Haveli from Portuguese rule in 1954. In 1961, São João Baptista de Ajudá's annexation by the Republic of Dahomey was the start of a process that led to the final dissolution of the centuries-old Portuguese Empire.

According to the census of 1921 São João Baptista de Ajudá had 5 inhabitants and, at the moment of the ultimatum by the Dahomey Government, it had only 2 inhabitants representing Portuguese Sovereignty.

Another forcible retreat from overseas territories occurred in December 1961 when Portugal refused to relinquish the territories of Goa, Daman and Diu. As a result, the Portuguese army and navy were involved in armed conflict in its colony of Portuguese India against the Indian Armed Forces.

The operations resulted in the defeat and surrender of the limited Portuguese defensive garrison, which was forced to surrender to a much larger military force. The outcome was the loss of the remaining Portuguese territories in the Indian subcontinent. The Portuguese regime refused to recognize Indian sovereignty over the annexed territories, which continued to be represented in Portugal's National Assembly until the military coup of 1974.

Also in the early 1960s, independence movements in the Portuguese overseas provinces of Angola, Mozambique and Guinea in Africa, resulted in the Portuguese Colonial War (1961–1974).

Throughout the colonial war period Portugal had to deal with increasing dissent, arms embargoes and other punitive sanctions imposed by most of the international community. However, the authoritarian and conservative Estado Novo regime, first installed and governed by António de Oliveira Salazar and from 1968 onwards led by Marcelo Caetano, tried to preserve a vast centuries-long intercontinental empire with a total area of 2,168,071 km2.

Carnation Revolution and European integration

The Portuguese government and army resisted the decolonization of its overseas territories until April 1974, when a bloodless left-wing military coup in Lisbon, known as the Carnation Revolution, led the way for the independence of the overseas territories in Africa and Asia, as well as for the restoration of democracy after two years of a transitional period known as PREC (Processo Revolucionário Em Curso). This period was characterized by social turmoil and power disputes between left- and right-wing political forces. The retreat from the overseas territories and the acceptance of its independence terms by Portuguese head representatives for overseas negotiations, which would create independent states in 1975, prompted a mass exodus of Portuguese citizens from Portugal's African territories (mostly from Portuguese Angola and Mozambique).

Over one million Portuguese refugees fled the former Portuguese provinces as white settlers were usually not considered part of the new identities of the former Portuguese colonies in Africa and Asia. Mário Soares and António de Almeida Santos were charged with organising the independence of Portugal's overseas territories. By 1975, all the Portuguese African territories were independent and Portugal held its first democratic elections in 50 years.

Portugal continued to be governed by a Junta de Salvação Nacional until the Portuguese legislative election of 1976. It was won by the Portuguese Socialist Party (PS) and Mário Soares, its leader, became Prime Minister of the 1st Constitutional Government on 23 July. Mário Soares would be Prime Minister from 1976 to 1978 and again from 1983 to 1985. In this capacity Soares tried to resume the economic growth and development record that had been achieved before the Carnation Revolution, during the last decade of the previous regime. He initiated the process of accession to the European Economic Community (EEC) by starting accession negotiations as early as 1977.

Portugal bounced between socialism and adherence to the neoliberal model. Land reform and nationalizations were enforced; the Portuguese Constitution (approved in 1976) was rewritten in order to accommodate socialist and communist principles. Until the constitutional revisions of 1982 and 1989, the constitution was a highly charged ideological document with numerous references to socialism, the rights of workers, and the desirability of a socialist economy. Portugal's economic situation after its transition to democracy, obliged the government to pursue International Monetary Fund (IMF)-monitored stabilization programs in 1977–78 and 1983–85.

In 1986, Portugal joined the European Economic Community (EEC) that later became the European Union (EU). In the following years Portugal's economy progressed considerably as a result of EEC/EU structural and cohesion funds and Portuguese companies' easier access to foreign markets.

Portugal's last overseas territory, Macau, was peacefully handed over to the People's Republic of China (PRC) in 1999, under the 1987 joint declaration that set the terms for Macau's handover from Portugal to the PRC. In 2002, the independence of East Timor (Asia) was formally recognized by Portugal, after an incomplete decolonization process that was started in 1975 because of the Carnation Revolution, but interrupted by an Indonesian armed invasion 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 Treaty of Lisbon entered into force, after it had been signed by the European Union member states on 13 December 2007 in the Jerónimos Monastery, in Lisbon, enhancing the efficiency and democratic legitimacy of the Union and improving the coherence of its action. The Republic of Ireland was the only EU state to hold a democratic referendum on the Lisbon Treaty; it was initially rejected by voters in 2008.

Economic disruption and an unsustainable growth in borrowing costs in the wake of the late-2000s financial crisis led the country to negotiate in 2011 with the IMF and the European Union, through the European Financial Stability Mechanism (EFSM) and the European Financial Stability Facility (EFSF), a loan to help the country stabilise its finances.