Spain has proclaimed a number of Constitutions. The current Magna Carta of 1978 is the culmination of the Spanish transition to democracy.
The idea of a national constitution for Spain arose from the Declaration of the Rights of Man and of the Citizen initiated as a result of the French Revolution
The earliest document recognized as such was La Pepa passed in 1812 as a result of the Peninsular War (1807–1814), which was a military conflict between the First French Empire and the allied powers of the Spanish Empire, the United Kingdom of Great Britain and Ireland and the Kingdom of Portugal for control of the Iberian Peninsula during the Napoleonic Wars.
During Franco's dictatorship, there were many attempts to create stable institutions that did not (at least directly) emanate from the dictator as they did in the post-war period. The Fundamental Laws of the Realm (Spanish: Leyes Fundamentales del Reino) were a constitution in parts enacted through nearly 20 years starting in the 1950s. They established the very institutions that would later, under Juan Carlos I and Prime Minister Adolfo Suárez, commit "constitutional suicide" and pass the Political Reform Act, starting the Spanish transition to democracy. Most of those Laws theoretically provided for a quite free state, much in the fashion the Soviet constitutions granted many freedoms, but ultimately the power of the Caudillo was supreme.