After 39 years on the throne, King Juan Carlos of Spain will abdicate in favour of his son Crown Prince Felipe, the king said in a televised address on Monday.

Hours after the prime minister, Mariano Rajoy, broke the news, the king explained his decision on Spanish television and radio. He highlighted his pride in the "transformation of Spain" and the "tremendous amount achieved by all" since the country's transition into democracy.

"Today, when I look back, I cannot help but feel pride and gratitude towards all of you," he said.

Felipe and his wife, Letizia. Photograph: Ignacio Lopez/EPA

The decision to step down, he said, was made after his 76th birthday in January. His son Felipe, he assured Spaniards, "has the maturity, preparation, and sense of responsibility necessary to assume the title of head of state and open a new era of hope which combines the experience and momentum of a new generation."

Once one of the world's most popular monarchs, more recently Juan Carlos has been plagued by a series of scandals that have sent his popularity plummeting. A poll by El Mundo last year found that nearly two-thirds of Spaniards thought the king should abdicate.

In contrast, Prince Felipe, a former Olympic yachtsman, has come out relatively unscathed. 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.

Fluent in English, French and Catalan along with Spanish, Felipe studied for a year in Canada before undertaking three years of military training in Spain's army, navy and air force academy. A law degree in Madrid soon followed, as well as a Masters in international relations at Georgetown University in Washington, DC

"His goal, his only goal, is to serve Spain. It has been deeply ingrained in him that he must be the country's main servant," his mother Queen Sofia once said.

Carlos and his wife Princess Sophia of Greece in Athens during their wedding. Photograph: Ho/AFP/Getty Images

The poll showing rising public support for Juan Carlos to abdicate was a stunning reversal for a leader who in 2012, had earned the approval of almost 80% of Spaniards. Taking the throne just two days after the death of Franco in 1975, Juan Carlos won the respect of Spaniards by steering the country from dictatorship to democracy, including foiling a coup attempt in 1981.

But as Spain fell into financial crisis, the king's standing sank. A particularly low point came when it was revealed that he had taken a luxurious trip to Botswana to hunt elephants, just weeks after telling a reporter that he was so distraught about the growing ranks of the unemployed that he was having trouble sleeping.

King Juan Carlos on his €10,000-a-day hunting safari in Botswana, which had been hushed up before he fell and broke his hip. Photograph: Target Press/Barcroft Media

The royal family's image was further tarnished by a long-running corruption investigation into the king's daughter, Princess Cristina, and her husband Iñaki Urdangarin.

Many, particularly young Spaniards, began to see the king as part of Spain's problems, drawing parallels between him and the economic and political powers that had driven the country into the economic crisis. While the king's approval rating dropped steadily, that of his son Felipe remained stable at around 66%, leading many to suggest that the monarchy would be better off if the king abdicated.

In Monday's announcement, Rajoy praised Juan Carlos, calling him a "tireless defender of our interests". He added: "I'm convinced this is the best moment for change."

Spain is now expected to change its constitution to make sure Felipe's first-born daughter Leonor can succeed him.

The royal family has said its wants the change to ensure she is next in line to the throne in the event that Felipe's wife gets pregnant again and gives birth to a boy, who would become monarch under the current constitution.

Analysts say that could open the door to political negotiations for additional proposed constitutional changes, including demands by the leading opposition Socialist Party to grant Catalonia more autonomy or special financial benefits to ease separatist feelings.

Artur Mas, the president of Catalonia, declared that the king's abdication would not derail his plans to hold the vote asking Catalans whether they want to secede from Spain. "We have a date with our future on 9 November," Mas told reporters after the king gave his speech.

Rajoy's government must now pass a law creating a legal mechanism for Felipe's assumption of power, which will then allow Juan Carlos to set a date for his formal abdication.