Can Spanish king's sacrifice save his troubled nation's monarchy?
Spain's Juan Carlos is abdicating in the wake of a series of scandals. Can his heir, Felipe, restore pride in this troubled nation's monarchy?
They had two plans. The first was to follow the example of the British monarch after her famous annus horribilis by toughing it out and hoping that Juan Carlos could eventually recover the same degree of popularity enjoyed by Britain's Queen Elizabeth in her jubilee year.
If that failed, a plan B would be put in place following what palace officials called the Dutch model. The king would abdicate and his son, Prince Felipe, would be raised to the throne. He, at least, was still popular.
Juan Carlos has now come to the conclusion that he can no longer save the monarchy from its plummeting popularity. "A new generation is rightly claiming its role as protagonist, just as happened in a crucial moment of the history of the generation to which I belong," he said as he announced his abdication in favour of 46-year-old Felipe.
It is a humiliating end to four decades on the throne and comes despite the king generally being viewed as having made a great, even historic, contribution to his country.
Juan Carlos, now 76, was placed on the throne in 1975 by the dictator General Francisco Franco, and inherited a dictator's powers. But he gave those up and helped steer Spain into a remarkable and relatively peaceful transition to democracy.
Proof of his success was that even some die-hard republicans were happy to vote for a 1978 constitution that turned Spain into a parliamentary monarchy. Many of those who did not want a monarch recognised that, with Juan Carlos on board, it would be easier to keep the old Francoists at bay and prevent a coup d'état.
But in a country that had spent much of the 20th century without a monarch, the king's position also needed artificial bolstering. A pact with the press, which refused to publish information about the king's lovers or the scandalous business dealings that people around him became involved in, helped him maintain a squeaky clean, patrician image.
He was touted to the world as the "people's king", a man who worked hard and lived modestly. Spaniards were genuinely grateful for the way Europe's last great executive king had guided them along the difficult path to democracy, stepping forward to stop the 1981 coup d'état in which the plotters mysteriously believed they had the monarch's backing.
With the democratic transition consolidated, however, the gloves eventually came off. The press shed self-censorship, but the king continued to behave as if protected from scrutiny.
Support finally collapsed when he was caught secretly flitting off to Botswana to hunt elephants in 2012 in the company of, among other people, a woman who was not his wife - while the rest of Spain suffered the worst economic crisis in memory.
The contrast between his lifestyle and theirs became blindingly apparent. "They had to do something. The monarchy's popularity was falling faster than that of any other institution," said political scientist Professor Ignacio Sanchez-Cuenca, of Madrid's Carlos III University.
Whether the abdication can lance the boil remains to be seen: thousands of anti-royalists took to the streets across Spain last week calling for a vote on the monarchy's survival.
"The monarchy has nothing to do with the young, nothing to do with the present time. It makes no sense and only generates expenses," said Bettina Farjado, an unemployed 32-year-old in central Madrid.
While Felipe faces an uphill battle to revive the monarchy's popularity, nobody can say he is not prepared.
During the first Iberian-American summit in Mexico in 1991, then-Cuban president Dr Fidel Castro went up to Juan Carlos and whispered in his ear.
"I wanted to ask you one thing. That son of yours who is so tall and so handsome, what does he do? Is he a sort of deputy king?" Castro asked, according to the king's top aide at the time, Sabino Fernandez Campo.
"Being an heir means preparing to be king," Juan Carlos replied with a smile.
Felipe has spent decades preparing for the task he is now close to tackling. In recent years, his responsibilities representing the crown have increased, so much so that he has the most intense agenda in the royal family, even compared with his father.
Felipe Juan Pablo Alfonso de Todos los Santos de Borbon y Grecia - his full name - started his preparations for the throne as early as age nine, when he became prince of Asturias, the title of Spain's crown princes.
Although he is younger than his sisters Elena and Cristina, he was designated his father's successor as the only male child of Juan Carlos and Queen Sofia. His father has said several times that Felipe will be the "best-prepared Bourbon in Spain's history".
For one thing, he will be the first Spanish king with a university degree, after studying law at Madrid's Autonomous University and getting a master's in international relations from Georgetown University in the US.
Beyond that, he has held officer rank in all three of Spain's armed forces - an army lieutenant colonel, a frigate captain and an air force lieutenant colonel - and speaks English and French.
Nor has he been embroiled by the scandals that have plagued other members of his family. In contrast, Felipe, a former Olympic yachtsman, has emerged relatively unscathed - 66 per cent of Spaniards have a positive image of him, according to an El Mundo poll last year, compared with just 41 per cent for his father.
Frequently photographed while taking their two daughters to school or at shopping malls, Felipe and his wife Letizia Ortiz - a former television news anchor - have cultivated an image of leading a relatively modest lifestyle.
Felipe has repeatedly hinted that the monarchy will be different under his leadership. "I want to put into practice my firm and constant desire to adapt the institution to the times we are living in at each moment, leading a project that links our history with the future and that encompasses our traditions with a forward-thinking, progressive spirit," he said in 2011.
Recognising the country's economic difficulties, smouldering republican sentiment and a growing independence movement in Catalonia, Felipe used his first remarks after his father's announcement to urge the nation to unite for a better future.
"In difficult periods such as these we are going through, past experience in history shows us that only by uniting our desires, putting the common good ahead of individual interests and promoting the initiative, curiosity and creativity of each person, can we manage to advance to better scenarios," Felipe said.
"This is the spirit that everyone - institutional heads, social and economic agents, organisations and citizens - should have so as to decisively confront the future and broaden the field of hope that opens up before us."
Additional reporting by McClatchy-Tribune