King Juan Carlos of Spain has decided to abdicate, Prime Minister Mariano Rajoy has announced.
King Juan Carlos, who is 76, has ruled since 1975, taking over after the death of dictator Francisco Franco.
The king's son, Crown Prince Felipe, 45, will take over the throne, the BBC reports.
For much of his reign, Juan Carlos was seen as one of the world's most popular monarchs but recently many Spaniards have lost confidence in him.
His reputation has been tarnished by a long-running corruption investigation into his daughter and her husband.
Support for the king fell further when it was discovered he had been on a lavish elephant-hunting trip to Botswana in the middle of Spain's financial crisis.
Mr Rajoy said the king was stepping down for personal reasons. His health is failing and he has had a number of hip operations in recent years.
Juan Carlos had been a "tireless defender of our interests", he said.
"I'm convinced this is the best moment for change."
Ministers will hold a special meeting on the issue.