The history of Spain dates back to the Antiquity when the pre-Roman peoples of the Mediterranean coast of the Iberian Peninsula made contact with the Greeks and Phoenicians and the first writing systems known as Paleohispanic scripts were developed. In 1516, Habsburg Spain unified a number of disparate predecessor kingdoms; its modern form of a constitutional monarchy was introduced in 1813, and the current democratic constitution dates to 1978. After the completion of the Reconquista, the Crown of Castile began to explore across the Atlantic Ocean in 1402, expanding into the New World and marking the beginning of the Golden Age under the Spanish Empire. The kingdoms of Spain were united under Habsburg rule in 1516, that unified the Crown of Castile, the Crown of Aragon and smaller kingdoms under the same rule. Until the 1650s, Habsburg Spain was the most powerful state in the world and remained among the most powerful until early 19th century.
During this period, Spain was involved in all major European wars, including the Italian Wars, the Eighty Years’ War, the Thirty Years’ War, and the Franco-Spanish War. In the later 17th century Spanish power began to decline, after the death of the last Habsburg.
The former Spanish Empire overseas quickly disintegrated with the Spanish American wars of independence. Only Cuba and the Philippines and some small islands were left; they revolted and the United States acquired ownership (or control, in the case of Cuba) after the Spanish–American War of 1898. A tenuous balance between liberal and conservative forces was struck in the establishment of a constitutional monarchy in Spain during the Borbonic restoration; this period began in 1874 and ended in 1931. The Liberal Party ( Práxedes Mateo Sagasta) and Conservative Party (Antonio Cánovas del Castillo) fought for and won short-lived control without any being sufficiently strong to bring about lasting stability. They were alternately in power. The Restoration began with Alfonso XII and the Regency of Maria Christina (1874–1898). Alfonso XII died aged 27 in 1885, and was succeeded by his unborn son, who became Alfonso XIII (1902-1923). Then came the dictatorship of General Primo de Rivera (1923-1930). Opposition to his regime was so great that Alfonso XIII stopped supporting him and forced him to resign in January 1930. In 1931, following a victory by the left, the Popular Front, in municipal elections, Alfonso XIII left Spain and the democratic republic was proclaimed in Spain. The Conservative Party disappeared shortly after the proclamation of the Republic in 1931.. Five years later the country descended into the Spanish Civil War between the Republican and the Nationalist factions.
The nationalist victory in the conflict installed a dictatorship led by Francisco Franco, that lasted until 1975. The country experienced rapid economic growth in the 1960s and early 1970s. With the death of Franco in November 1975 did Spain return to the monarchy, this time headed by Juan Carlos I, and to democracy. With a fresh Constitution voted in 1978, Spain entered the European Economic Community in 1986 (transformed into the European Union with the Maastricht Treaty of 1992), and the Eurozone in 1999.