Between 1000 and 210 BC both Greeks and Phoenicians found settlements between in present-day Spain. At the end of this period Spain is under control of Carthago. The Roman Empire defeats Carthago in 201 BC and Spain becomes as Hispania part of this empire. After the collapse of the Roman Empire, after 409, Vandals, Sueves and Alanes travel through Spain. In 468 the Visigoths establish their kingdom, but in 711 it is conquered by the Caliphate. After the division of the Caliphate, the Moorish Emirate of Cordoba is formed in 756.

In the north of Spain small christian states come to existence, like Asturia, Leon and Castilla. In 1037 the Kingdom of Castilla includes Asturia and Leon. To the east of Castilla the Kingdom of Aragon is founded in 1137. Both kingdoms conquer parts of the Moorish ruled areas and Aragon includes also islands like Sardinia and Sicily. In 1479 Aragon and Castilla unite in the Kingdom of Spain and in 1492 the last Moorish settlements around Granada are conquered.

Between 1515 and 1555 Spain is united in a personal union with Austria and the building of a large colonial empire starts. During the 16th century, Spain becomes the most powerful nation in Europe, due to the immense wealth derived from its presence in the Americas. But a series of long, costly wars and revolts begin a steady decline of Spanish power in Europe. The Netherlands, a Spanish posession since the personal union, liberate themselves in a war between 1568 and 1609 (recognized in 1648). Between 1580 and 1640 Spain forms a personal union with Portugal.

Controversy over succession to the throne consumes the country during the 18th century, leading to an occupation by France during the Napoleonic era between 1803 and 1814 and leads to a series of armed conflicts throughout much of the 19th century. During and following the French occupation most of the American colonies become independent. In 1820 Spain becomes a constitutional monarchy.

Political power alternates between parties and the premiership changes quickly. Ruling parties are the liberals (1820-1822, 1822-1823, 1824-1826), the moderates (1822), and absolutists (1823-1824). Absolutists are in ppiwer again between 1826 and 1832. Between 1832 and 1841 most of the time the Partido Liberal (Liberal Party, PL) governs the country. The Partido Monárquico Constitutional (Constitutional Monarchy Party, PMC) takes over between 1841 and 1854. After a military interruption the Unión Liberal (Liberal Union, UL) comes to power in 1856. It rules, renamed PL in between, with some interuptions until 1873. In this time a major party is the left-wing liberal Partido Progresista (Progressive Party, PP)

Between 1873 and 1874 Spain is a republic (Spanish Republic), rules by the Partido Democratic (Democratic Party, PD) and the Partido Republicano Federalista (Federalist Republican Party, PRF). The monarchy is restored in 1874. The period of an alternation of power between what later gets known as the liberal Partido Liberal-Fusionista (Fusionist Liberal Party, PLF, merger of the PL and the PP) and the Partido Liberal Conservador (Conservative Liberal Party, PLC) as well as factions of these parties, like the Partido Liberal-Democrático (Liberal Democratic Party, PLD) and the Partido Democrático-Monárquico (MOnarchist Democratic Party, PDM) starts. This period lasts until 1922. As a result of the Spanish-American war in 1898 and 1899 Spain loses its remaining colonies outside of Africa.

Between 1923 and 1930 Spain is a military dictatorship under Miguel Primo de Rivera y Orbaneja. Democracy is restored in 1930. One year later Spain becomes a republic named Spanish Republic. Niceto Alcalá Zamora y Torres of the conservative Derecha Liberal Republicana (Liberal Republican Right, DLR) becomes the first prime minister, succeeded later that year by Manuel Azaña y Díaz of the liberal democratic Acción Republicana (Republican Action, IR). Zamora becomes president in 1931 of the new republic. In 1933 the Partido Republicano Radical (Radical Republican Party, PRR) takes over power. Alejandro Lerroux García becomes prime minister (with some interruptions by co-partisans) until 1935. At the end of 1935 Manuel Portela Valladares of the OC becomes prime minster. After the 1936 elections Manuel Azaña y Díaz, now leader of the Izquierda Republicana (Republican Left, IR) becomes prime minister. When he is elected president, he is succeded by some interim premiers, but at the end of 1936 the Partido Socialista Obrero Español (Spanish Socialist Workers' Party, PSOE) holds the premiership with Francisco Largo Caballero (until 1937) and Juan Negrín López (until 1939)

Since 1936 nationalist start a civil war starts against the republican government. This leads in 1939 to the victory of nationalist forces. Francisco Franco Bahamonde becomes dictator of the Spanish State. Although the monarchy is restored in 1947, Franco rules the country as head of state until his death in 1975. He establishes the Falange Española Tradicionalista-Juntas de Ofensivas Nacional Sindicalistas (Spanish Phalange Traditionalists-Junta of National Syndicalist Offensive, FET) as the sole legal party.

Juan Carlos de Borbón y Borbón, who assumes the throne, realizes a rapid transition into a stable parliamentary democratic monarchy. He appoints in 1976 Adolfo Suárez Gonzálvez of the Unión Centro Democrático (Union of Democratic Center, UCD) as prime minister. The UCD wins the 1977 parliamentary elections. In 1981 rebel elements among the security forces sieze parliament and try to impose a military-backed government. However, the great majority of the military forces remain loyal to the king, who uses his personal authority to put down the bloodless coup attempt. That year Suárez resigns and is succeeded by Leopoldo Calvo Sotelo y Bustelo of the UCD. In 1982, the PSOE, led by Felipe González Márquez, wins an absolute majority in parliament. swept both the Congress of Deputies and Senate, winning an absolute majority. Gonzalez and the PSOE rule for the next 13 years. Spain joins the European Communities (renamed European Union in 1993) in 1986.

In 1996 José María Aznar López's Partido Popular (People's Party, PP) wins a plurality of votes. Aznar moves to decentralize powers to the regions and liberalizes the economy. The PP wins re-election in 2000. Some days before the 2004 elections, terrorists attack Madrilene railway stations. The elections itself are won by the PSOE and it can form a government under prime minister José Luis Rodríguez Zapatero.