Madrid: Spain's King Juan Carlos is abdicating after almost 40 years on the throne and his son Prince Felipe will succeed him, Prime Minister Mariano Rajoy said in a surprise announcement.
"His majesty, King Juan Carlos, has just communicated to me his will to give up the throne," Rajoy said. "I'm convinced this is the best moment for change."
New king for Spain
Brexit: Merkel warns no way back
What is Zika virus?
Turnbull reacts to Istanbul attacks
IS behind airport blast: Turkey PM
Istanbul attacks: Kerry and Trump weigh in
Australian in Turkey 'fortunate'
Istanbul attack videos show explosion, panic
New king for Spain
Spanish King Juan Carlos will abdicate his throne to his son, Prince Felipe.
Once popular Juan Carlos, who helped smooth Spain's transition to democracy in the 1970s after the Francisco Franco dictatorship, has lost public support in recent years due to corruption scandals and gaffes.
His daughter, Princess Cristina, and her husband, Inaki Urdangarin, are under investigation in a corruption case. Both deny any wrongdoing. A judge in Palma de Mallorca is expected to decide soon whether to put Urdangarin on trial on charges of embezzling 6 million euros ($A8.8 million) in public funds through his charity.
The 76-year-old king, whose health is failing and has had five operations in two years, including hip replacement surgery, is stepping down for personal reasons, Rajoy said.
Spain does not have a precise law regulating abdication and succession. Rajoy said his cabinet would meet very soon to set out the steps for Prince Felipe to take over as Felipe VI.
The country is just pulling out of a difficult and long recession that has seen faith in politicians, the royal family and other institutions all dwindle.
Felipe, 46, has had an increasingly important role in ceremonial events in the past year and has not been stained by the corruption case involving his sister and her husband.
Felipe's accession looked like a fresh start to passers-by in the streets of Madrid on Monday, who agreed it was time for the king to step aside.
"It was something that clearly had to happen," said Maria Jose Gonzalez, 55. "The king is elderly. Felipe is very prepared and will do very well."
But some would prefer no king at all, however. Twitter buzzed on Monday with irreverent messages about Juan Carlos and calls for a referendum on the monarchy.
"I would like for us Spanish people to be able to choose whether we want a monarchy or a republic. The monarchy is obsolete," Alejandro Ricas, a 19-year-old student, told AFP.
Protests took place on Monday evening with republicans taking to the streets calling for a referendum and the abolition of the monarchy.
Juan Carlos shaped Spain's modern history after taking the throne as the dictator Franco's appointed successor.
The monarch was once beloved for his common touch and was seen as much more accessible than the British royals.
In 2012, at the height of Spain's financial crisis, the king fell and broke his hip during an elephant-hunting trip in Botswana. The lavish privately funded safari was secret until his accident and came at a time of particularly harsh public spending cuts.
Sixty-two per cent of Spaniards were in favour of the king stepping down, according to a January poll by Sigma Dos. That compared with 45 per cent a year earlier. Only 41 per cent of those polled had a good or very good opinion of the king.
Felipe has a positive rating of 66 per cent and most Spaniards believe the monarchy could recover its prestige if he took the throne, according to the poll.
Felipe married divorced journalist Leticia Ortiz in 2004 and they have two daughters.