Spain set its future King Felipe VI on the path to the throne Tuesday, launching an unprecedented handover of the crown in the face of a breakout of anti-royalist protests.
One day after 76-year-old King Juan Carlos declared an end to a four-decade reign that guided Spain from dictatorship to democracy, the government met to ponder the first succession in post-Franco history.
Prime Minister Mariano Rajoy called an extraordinary cabinet meeting to draw up a draft abdication law, which must then be approved by parliament in a process that could take weeks.
The twilight of the king's reign has been beset by scandal.
Yet not all celebrated the impending arrival of his more popular son, 46-year-old Crown Prince Felipe, a tall former Olympic yachtsman, and his 41-year-old wife, the future queen Letizia, a glamorous former television news presenter.
Thousands of anti-royalists took to the streets across Spain in the hours after the abdication, calling for a vote on the monarchy's survival.
Protesters filled Madrid's central Puerta del Sol square and police closed access to the royal palace just a few minutes' walk away from the demonstration.
"Tomorrow, Spain will be a republic!", chanted crowds of demonstrators brandishing placards reading: "No more kings, a referendum", "A royal transition... without a king", and "Bourbons up for election".
"I think now would be a good time to proclaim a republic," said Paola Torija, a 24-year-old therapist for the disabled. "He had his moment of glory but today it is a bit archaic, a bit useless, an extra cost especially in the crisis we are living in."
Three small leftist parties -- Podemos, United Left and the Equo green party which together won 20 percent of the vote in May 25 European Parliament elections -- called for a referendum on the monarchy.
Spain's prime minister defended the monarchy and said a referendum would require a change to the constitution.
"I think the monarchy has the support of the great majority in Spain," Rajoy said when asked about referendum calls at a conference Tuesday in Madrid.
"Propose a constitutional reform if you don't like this constitution. You have the perfect right to do so. But what you cannot do in a democracy is bypass the law," he said.
Spain's 1978 constitution which established the monarchy was supported by a great majority of Spaniards in a referendum at the time, the prime minister said.
Juan Carlos was widely respected for smoothing Spain's transition to democracy after the death of General Francisco Franco in 1975, most famously facing down an attempted military coup in February 1981.
But many Spaniards were outraged when they discovered the king took a luxury elephant-hunting trip to Botswana in 2012 as they struggled to find jobs in a recession.
Resentment over the monarchy grew when the king's younger daughter Cristina was named a suspect in relation to her husband Inaki Urdangarin's allegedly corrupt business practices.
In a televised address to the nation on Monday, Juan Carlos said the economic crisis had awakened a "desire for renewal".
"Today a younger generation deserves to step into the front line, with new energies," said the monarch.
In a study by pollster Sigma Dos published in January 2014, support for the king fell to 41 percent while those wanting him to abdicate in favour of Felipe surged to 62 percent.
Most worryingly for royalists, the same survey found only 49 percent approved of the monarchy itself.
The future King Felipe VI faces a daunting challenge, analysts said.
"There will be tension, there will be difficult times, but the prince just has to demonstrate that he is capable, because he is. He has a clean record, is fair, hard working. You can't ask for more," royal biographer Cesar del al Lama told AFP.
"He will not be weighed down like the king by having a corrupt son-in-law. He will not make a mistake like the Botswana hunting trip."
Felipe will come to the throne as the government of the wealthy northeastern region of Catalonia is pushing to hold an independence referendum in November -- a vote that is fiercely opposed by the central government in Madrid.
The king has called Felipe, who was schooled for his future role as monarch in the three branches of the armed forces and during studies abroad, the "best prepared" heir to the Spanish throne in history.
He kept him at his side on the night of February 23, 1981 when soldiers firing shots over the heads of lawmakers seized parliament in a bid to re-establish a military regime.