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 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, and Silva Porto were founded or redeveloped inland during this period and beyond. 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, which had been claimed by Portugal and included in its "Pink Map", which clashed with British aspirations to create a Cape to Cairo Railway.
Domestically, Portugal was twice declared bankrupt (June 14, 1892 and May 10, 1902) causing industrial disturbances, socialist and republican antagonism and press criticism of the monarchy. An inefficient system of rotating governments which saw the Progressive Party and Regenerator Party alternating in power since the Portuguese Regeneration Era also resulted to a decline of the Portuguese political system. The republicans blamed King Don Carlos I of Portugal for many of the problems in the country.
On January 28, 1908, several republican leaders were imprisoned after the polices found republican Afonso Costa and Francisco Correia Herédia (viscount of Ribeira Brava), both armed, at the Municipal Library elevator with others who had gathered to attempt a coup d'état. During the events 93 republican sympathizers were detained and their arms confiscated, but the Republican Party was only partially dismantled.
As a consequence, King Carlos I of Portugal and his heir apparent, Prince Royal Dom Luís Filipe, Duke of Braganza, were murdered on February 1, 1908 in Lisbon's Commerce Square while returning from Vila Viçosa in Alentejo. Several days later, the King's younger son, Prince Manuel, was proclaimed as the new King with reigning name Manuel II of Portugal. However, the political situation degraded again quickly, leading to having seven different governments in the space of two years.
On October 3, 1910, the republican uprising foreshadowed by the political unrest finally took place. Between October 4–5, 1910, members of the Carbonária, republican youth and elements of the Army instigate a coup d'état against the already weak constitutional monarchy. The young King and his family escaped from the Palace in Mafra for exile to England. On the morning of October 5, 1910, the Republic was declared from the balcony of Lisbon City Hall, ending eight centuries of monarchy in Portugal. Teófilo Braga was elected president of the provisional government a day later.
First Republic era
The Constitution of the Republic was approved in 1911, inaugurating a parliamentary regime with reduced presidential powers and two chambers of parliament. Manuel de Arriaga was elected as first President of the Republic. The republic which established by the constitution was anticlerical and had a hostile approach to the issue of church and state separation, like that of the French Revolution, and the future Mexican Constitution of 1917 and Spanish Constitution of 1919. It provoked important fractures within Portuguese society, notably among the essentially monarchist rural population, in the trade unions, and in the Church.