On December 27, 1978, King Juan Carlos I signed into law the Spanish Constitution, which began the country’s official shift into democracy. On that morning in December of 1978, newspapers around the country ran headlines reading, “Good morning, democracy.”
When Franco died in 1975 many people expected Juan Carlos to stand back and let the fascist regime continue, but instead he
immediately began to dismantle the fascist government of Spain. He became king two days after Franco’s death and the first reigning monarch since 1931. The country held its first open and free elections in 1977, with over 150 political parties represented. The Communist Party was officially legalized. Juan Carlos granted amnesty to political prisoners. Languages like Catalan, Gallego, and Euskera, which had been forbidden, were now freely spoken.
But while often cited as a paradigm of peaceful, negotiated transition, violence during the Spanish transition was far more prevalent than during the analogous democratization processes in Greece or Portugal, with the emergence of separatist, revolutionary, neo-fascist and vigilante terrorist groups.
When the Spanish Socialist Worker's Party (PSOE, Partido Socialista Obrero Español) took the majority of seats in Parliament in the 1980s, real reforms were spread through the country.
https://en.wikipedia.org/wiki/Constitution_of_Spain
https://en.wikipedia.org/wiki/Spanish_transition_to_democracy