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 did not 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 () 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.