MADRID (AFP) - Spain's King Juan Carlos signs an act of abdication on Wednesday to end his 39-year reign, as a flag-festooned Madrid spruces up its streets for the people to hail his 46-year-old son as their new king, Felipe VI.
The 76-year-old Juan Carlos, who led Spain from dictatorship to democracy but was later hurt by scandals, puts his name to his last act of parliament in the late afternoon at Madrid's old Royal Palace.
Even before the king inks his abdication, to be ratified by Prime Minister Mariano Rajoy in a solemn ceremony before 150 guests at the palace, workers outside were setting out some of the 16,000 flowers to adorn the streets at the start of the future King Felipe VI's reign on Thursday.
The red-and-yellow Spanish flag hung across much of the city centre; two huge flags covered the entire facade of Madrid's City Hall, others fluttered from balconies and the city is to let them fly from 470 lampposts and 730 buses while handing out a further 100,000 to the public.
Some 7,000 police have been deployed to secure the celebrations.
Felipe, a blue-eyed former Olympic yachtsman who stands 1.98 metres tall, legally takes the throne at midnight Wednesday when his father's abdication becomes effective, government officials say.
Felipe's wife, the elegant 41-year-old former television news reader Letizia, will be queen. They have two blonde-haired daughters, seven-year-old Sofia and eight-year-old Leonor, who will become the youngest direct heir to the throne in Europe.
The new king is to be proclaimed Thursday after being sworn in by both houses of parliament, where he will give a speech before being driven through Madrid's streets and then appearing before the crowds on the front balcony of the Royal Palace.
He faces a daunting task to clean up the image of the young monarchy, which was only restored when his father Juan Carlos took the throne in 1975 after the death of General Francisco Franco, who had ruled for some four decades.
Juan Carlos, who walks with a cane after repeated hip operations, outraged Spaniards in 2012 by going on a luxurious African elephant-hunting safari during a biting recession.
Felipe's 49-year-old sister Cristina risks being put on trial for alleged tax fraud in relation to the allegedly dodgy business activities of her husband, former Olympic handball player Inaki Urdangarin. She is not invited to the succession party.
Beyond surmounting his own family's woes, Felipe must inspire a people grappling with a 26 per cent unemployment rate and try to unite the nation even as the northeastern region of Catalonia seeks an independence referendum on Nov 9.
Though many Spaniards would have preferred a referendum on the future of the monarchy after Juan Carlos' reign, they appear ready to give the new monarch a fresh slate.
"He has to change some things," said Antonio Molina, 60, who works at a cold drinks stall near the Royal Palace.
"I think Spain is in good shape despite the problems but he has to change some things. He needs to renew the monarchy to get over everything that has happened, and a bit more."
A poll taken after King Juan Carlos announced his abdication on June 2 showed 76.9 per cent of respondents had a good or very good opinion of the prince.
But analysts say some people may have raised their hopes too high, stressing that reform in a democracy is a job for politicians and judges, not for a king.
"Right now the Spanish want him to do just about everything: sort out Catalonia, sort out unemployment," said Cote Villar, a royal specialist at the daily El Mundo.
"They hope this new face will also be the new face of Spain's institutions, which are in crisis. But at the end of the day he is just the king of a parliamentary democracy, who cannot do much."