In a shocking announcement, King Juan Carlos of Spain said he will be abdicating the throne after a 39-year reign.

The king's son, Prince Felipe, will be his successor, the BBC reported. The prime minister, who is the political head of the parliamentary-monarchy government, was the first to announce the king's abdication.

"His Majesty King Juan Carlos has just informed me of his desire to renounce the throne and begin the process of succession," Prime Minister Mariano Rajoy said according to the BBC.

King Juan Carlos, 76, is said to be one of the most-loved royals in power. He held democratic elections in 1977, the country's first since 1936, which led to Spain's parliament.

But the king's popularity has declined recently due to lavish spending and allegations that his daughter was involved in business corruption, the BBC reported.

King Juan Carlos later announced he was stepping down during a televised speech.                                        

It is "time to hand over a new generation- younger, with a lot of energy- that can, with determination, take on and carry out the changes that the current situation demands, and to face with intensity and determination the challenges of tomorrow," the king said according to CNN.

"The long, deep economic crisis we are going through has left a lot of scars socially, but it has also pointed toward a future of hope," he said.

The king's abdication, though sudden, is not completely unexpected for Spain's citizens, the BBC reported.

The monarch lost credibility when the public found out he went on an expensive elephant hunting trip in Botswana in 2012 while the rest of the country was experiencing high unemployment and economic downturn.

Princess Cristina, the king's daughter, and her husband Inaki Urdangarin were also investigated for suspected embezzlement and tax fraud.

Prince Felipe and his wife Princes Letizia are said to have been unaffected by the scandals.