Spain's King Juan Carlos said on Monday he would abdicate in favor of his son Prince Felipe, aiming to revive the scandal-hit monarchy at a time of economic hardship and growing discontent with the wider political elite.
"A new generation is quite rightly demanding to take the lead role," Juan Carlos, 76, said on television, hours after a surprise announcement from Prime Minister Mariano Rajoy that the monarch would step down after almost 40 years on the throne.
The once popular Juan Carlos, who helped smooth Spain's transition to democracy in the 1970s after the Francisco Franco dictatorship, seemed increasingly out of touch in recent years.
Urgent: Do You Approve of Obama's Handling of Foreign Policy? Vote Here
He took a secret luxury elephant-hunting trip to Botswana in 2012, a time when one in four Spanish workers was jobless and the government teetered on the brink of default.
A corruption scandal in the family and his visible infirmity after repeated surgery in recent years have also eroded public support. Polls show greater support for the low-key Felipe, 46, who has not been tarnished by the corruption allegations.
The king's younger daughter, Princess Cristina, and her husband, Inaki Urdangarin, are under investigation and a judge is expected to decide soon whether to put Urdangarin on trial on charges of embezzling 6 million euros in public funds through his charity. He and Cristina deny wrongdoing.
The king, who walks with a cane after multiple hip operations and struggled to speak clearly during an important speech earlier this year, is stepping down for personal reasons, Rajoy said.
But a source at the royal palace told Reuters the abdication was for political reasons. The source said the king decided in January to step down, but delayed the announcement until after the European Union election on May 25.
Political analysts said the ruling conservative People's Party (PP) was eager to put the more popular Felipe on the throne to try to combat increasingly anti-monarchist sentiment, after small leftist and anti-establishment parties did surprisingly well in the election.
The country is just pulling out of a long recession that dented faith in politicians, the royal family and other institutions. The PP and the Socialists, which have dominated politics since the return to democracy, are committed to the monarchy, but they polled less than 50 percent between them in the recent election.
Smaller leftist parties Podemos, United Left and Equo green party, which together took 20 percent in the European vote, all called on Monday for a referendum on the monarchy.
"People are calling for political regeneration, a change in the institutional functioning of the state after around 40 years of democracy, and they've started with the royals," said Jordi Rodriguez Virgili, professor of political communication at Navarra University.
Spain does not have a precise law regulating abdication and succession. Rajoy's cabinet was scheduled to have an extraordinary meeting on Tuesday to set out the steps for Prince Felipe to take over as Felipe VI. The transition will likely be accomplished by passing a law through parliament, where the PP has an absolute majority.
"We've been hearing continuously over the last few months on the necessity for deep change. The feeling is that the European elections have been a turning point and I believe the decision has been made in this context," said Rafael Rubio, constitutional expert at Madrid's Complutense University.
There has been media speculation over an abdication since last year, but the announcement was unexpected.
"We were very surprised," Spain's tennis champion Rafa Nadal said when asked for his response, adding that his country should be grateful to the king for the role he had played.
"On a personal note, he was always very nice to me, very warm," the world number one said at the French open in Paris. "He made me feel comfortable each time we met."
Sixty-two percent of Spaniards were in favour of the king stepping down, according to a January poll by Sigma Dos. That compared with 45 percent a year earlier. Only 41 percent of those polled had a good or very good opinion of the king.
Felipe has a positive rating of 66 percent and most Spaniards believe the monarchy could recover its prestige if he took the throne, according to the poll.
"Felipe has a lot more energy to do the job," said Alfonso Romero, 36, a student.
Political analysts speculated Felipe may try to seek dialogue between Rajoy and Catalan President Artur Mas, who is leading a movement to break away from Spain. But Mas said on Monday that Felipe's taking the throne would not dissuade him from trying to hold a referendum on independence in November.
The prince, who has had a growing role in ceremonial events in the past year, is seen as more practical and in tune with current affairs than Juan Carlos, a jovial skier and sailor once beloved for his common touch and seen as much more accessible than the older generations of British royals.
Juan Carlos will be the second European monarch to abdicate in just over a year. Queen Beatrix of the Netherlands stepped down in April 2013 to make way for her son Willem-Alexander.
Felipe married divorced journalist Letizia Ortiz in 2004 and they have two daughters. The royal family began a Twitter feed (@CasaReal) on their tenth wedding anniversary, May 21, with tweets on both Juan Carlos and Felipe's weekend visit to El Salvador for the swearing in of President Salvador Sanchez Ceren.
The prince was in Spain on Monday but had no official events planned until Tuesday when he is scheduled to appear with the king at the El Escorial monastery and former royal palace.
As king, Felipe will be Spain's head of state, representing the country at summits, official visits and in meetings with business leaders.
Even if he can win Spaniards over, he will continue to face a sense that the country does not need a king.
"I'm not a monarchist and don't have a high opinion of them," said Maria Luisa Villaseca, a retired public employee visiting the medieval city of Toledo. "I think they should call a referendum and ask citizens what they want."
Urgent: Who Is Your Choice for the GOP's 2016 Nominee?