The Spanish transition to democracy was a complex process that gradually transformed the legal framework of the Francoist regime into a democratic state. The Spanish state didn't "abolish" the Francoist regime, but rather slowly transformed the institutions and approved and/or derogated laws so as to establish a democratic nation and approve the Constitution, all under the guidance of King Juan Carlos I of Spain. The Constitution was redacted, debated and approved by the constituent assembly (Spanish: Cortes .Constituyentes) that emerged from the 1977 general election. The Constitution then repealed all the Fundamental Laws of the Realm (the pseudo-constitution of the Francoist regime), as well as other major historical laws and every pre-existing law that contradicted what the Constitution establishes.
The Constitution is organized in ten parts (Spanish: Títulos) and an additional introduction (Spanish: Título Preliminar), as well as a preamble, several additional and interim provisions and a series of repeals, and it ends with a final provision. Part I refers to fundamental rights and duties, which receive special treatment and protection under Spanish law. Part II refers to the regulation of the Crown and lays out the King's role in the Spanish state. Part III elaborates on Spain's legislature, the Cortes Generales. Part IV refers to the Government of Spain, the executive power, and the Public Administration, which is managed by the executive. Part V refers to the relations between the Government and the Cortes Generales; as a parliamentary monarchy, the Prime Minister (Spanish: Presidente del Gobierno) is invested by the legislature and the Government is responsible before the legislature. Part VI refers to the organization of the judicial power, establishing that justice emanates from the people and is administered on behalf of the King by judges and magistrates who are independent, irrevocable, liable and subject to the rule of law only. Part VII refers to the principles that shall guide the economy and the finances of the Spanish state, subjecting all the wealth in the country to the general interest and recognizing public initiative in the economy, while also protecting private property in the framework of a market economy. It also establishes the Court of Accounts and the principles that shall guide the approval of the state budget. Part VIII refers to the "territorial organization of the State" and establishes a unitary state that is nevertheless heavily decentralized through delegation and transfer of powers. The result is a de factofederal model, with some differences from federal states. This is referred to as an autonomous state (Spanish: Estado Autonómico) or state of the autonomies (Spanish: Estado de las Autonomías). Part IX refers to the Constitutional Court, which oversees the constitutionality of all laws and protects the fundamental rights enshrined in Part I. Finally, Part X refers to constitutional amendments, of which there have been only two since 1978 (in 1995 and 2011).
A seven-member panel was selected among the elected members of the Cortes to work on a draft of the Constitution to be submitted to the body. These came to be known, as the media put it, as the padres de la Constitución or "fathers of the Constitution". These seven people were chosen to represent the wide (and often, deeply divided) political spectrum within the Spanish Parliament, while the leading role was given to then ruling party and now defunct Union of the Democratic Centre (UCD).
Each of the Spanish parties had its recommendation to voters.
The writer (and Senator by Royal appointment) Camilo José Cela later polished the draft Constitution's wording. However, since much of the consensus depended on keeping the wording ambiguous, few of Cela's proposed re-wordings were approved. One of those accepted was the substitution of the archaic gualda ("weld-colored") for the plain amarillo (yellow) in the description of the flag of Spain.
The constitution was approved by the Cortes Generales on 31 October 1978, and by the Spanish people in a referendum on 6 December 1978. 91.81% of voters supported the new constitution. Finally, it was sanctioned by King Juan Carlos on 27 December in a ceremony in the presence of parliamentarians. It came into effect on 29 December, the day it was published in the Official Gazette. Constitution Day on 6 December has since been a national holiday in Spain.