Between 1807 and 1811 Portugal is occupied by France: the royal see is replaced to the colony of Brazil in 1808. Portugal unites with its colony of Brazil in 1815 into the United Kingdom of Portugal, Brazil and Algarve. At that time the country is an absolute monarchy. Brazil secedes in 1822 from the kingdom and Portugal itself becomes a a constitutional monarchy, renamed Kingdom of Portugal since 1825. During the whole century there is a bitter political conflict between rival parties, verging at times on civil war. Dominant parties are the conservative Partido Regenerador (Renewal Party, PR), the liberal Partido do Progreso (Progress Party, PP) and the liberal Partido Ordeiro (Order Party). Since 1851 there is rotating change of power, the rotavismo between the PR and the PP and their facions. In 1906 the King gives dictatorial powers to João Franco.
After a revolution in 1910 Portugal becomes a republic under the name Portuguese Republic. The republic is strongly instable and it has a lot of presidents. The first president is Joaquim Teófilo Fernandes Braga (1910-1911) for the Partido Repúblicano Português (Portuguese Republican Party, PRP, aslo known as Partido Democrático (Democratic Party, PD). He is succeeded by Manuel José de Arriaga Brum da Silveira e Peyrelongue (1911-1915, PRP). Braga returns in office in 1915, but is in that year succeeded by Bernardino Luís Machado Guimarães (PRP). After a military revolution in 1917 Sidónio Bernardino Cardoso da Silva Pais becomes president. He is succeded in 1918 by João do Canto e Castro Silva Antunes. In 1919 António José de Almeida of the Partido Repúblicano Evolucionista (Republican Evolutionist Party, PRE) becomes president, succeeded in 1923 by Manuel Teixeira Gomes (PRP) and in 1925 by Bernardino Luís Machado Guimarães (PRP). The number of prime ministers is even more. Between 1910 and 1926 Portugal has around 40 changes of premiership.
The army seizes power in 1926. António Óscar de Fragoso Carmona becomes president (until 1951). The military junta makes Domingos Augusto Alves da Costa e Oliveira prime minister in 1930. He represents the sole legal party, the UN. When António de Oliveira Salazar is appointed prime minister in 1932 Portugal becomes a semi-fascist dictatorship. In 1951 Francisco Higino Craveiro Lopes becomes president. He is succeeded in 1958 by Américo de Deus Rodrigues Tomás. After his death in 1968 Salazar is suceeded by Marcelo das Neves Alves Caetano. In 1974 the army rebels against the dictatorship and radical factions try to gain control over the country. In this period António de Spinola becomes president en he strives after a return to democracy. Vasco dos Santos Gonçalves of the Movimento das Forças Armadas (Movement of Armed Forces, MFA) becomes prime minister. The radical factions force De Spinola to stand down and he is succeeded by Francisco da Costa Gômes. In 1975 José Baptista Pinheiro de Azevedo of the MFA succeeds Dos Santos.
In 1976 António dos Santos Ramalho Eanes, later leader of the Partido Renovador Democrático (Party of Democratic Renovation, PRD) is elected president. Portugal becomes a stable parliamentary republic and prime minister Mário Alberto Nobre Lopes Soares of the social-democratic Partido Socialista (Socialist Party, PS) leads the first democratic government. From 1978 until 1980 the non-partisans Alfredo Nobre da Costa, Carlos da Mota Pinto and Maria de Lourdes Pintassilgo are prime ministers. After the elections of 1980 Francisco Lumbrales de Sá Carneiro of the conservative Partido Social Democrata (Social Democrat Party, PSD) becomes prime minister. He dies the same year and is succeeded by Francisco Pinto Balsemão. In 1983 the socialists take over again with Soares as prime minister. After the elections of 1985 a 10 year rule by the PSD starts. Aníbal Cavaco Silva becomes prime minister. Portugal joins the European Communities (renamed European Union in 1993) in 1986. After the elections of 1995 António Manuel de Oliveira leads a PS government. In 2002 José Manuel Durão Barroso of the PSD can take over.