Shortly after confiding to his countrymen that he had been unable to sleep at night because of all the young unemployed people in his country, Spanish King Juan Carlos secretly hopped aboard a plane and went on a lavish safari to Botswana, where he shot elephants.

When word leaked out this spring, Spaniards were outraged. Newspapers calculated that such hunting trips cost twice the country’s average annual salary. Tomas Gomez, a Socialist party leader, called on the king to choose between his “public responsibilities or an abdication.” Now, critics are calling on him to slash his budget and reveal how he is spending the money.

The backlash against the 74-year-old king is part of a broader soul-searching in Europe about the role and relevance of monarchies as the economic crisis deepens.

While it is the royals’ fairy-tale lives — the palaces, couture and love affairs — that have made many of them such fascinating public figures, that extravagance now seems out of place. Politicians, local media outlets and average citizens are openly questioning why taxpayers should be footing the bill for royals — who consume tens of millions of dollars each year — while much of the rest of the population of the continent suffers amid cuts in civil-service salaries, pensions and health care.

“As the problems with public finances have intensified, so, too, have the questions about the monarchies and their spending,” said Herman Matthijs, a professor at the University of Ghent and University of Brussels who conducts an annual study of the costs associated with European heads of state.

In Belgium, King Albert II found himself in the hot seat this year after his official budget was increased by 3 percent, prompting him to announce that he would cover some of his own expenses for the next two years, saving the country the equivalent of $616,000. Dutch Queen Beatrix, who has faced criticism about maintenance costs for her yacht being borne by her country’s Defense Ministry, said she would pay them herself.

Even Queen Elizabeth II, who celebrated her diamond jubilee in June before a sea of 1 million adoring British citizens, has not been immune from pressure to slash the monarchy’s budget. She froze staff salaries, postponed maintenance work on royal residences and dropped the full-time security protection for Princess Beatrice and Princess Eugenie.

This week, nude photos of Prince Harry partying in Las Vegas brought a flurry of criticism to the royal house, claiming abuse of the 24-hour taxpayer-funded security detail that is assigned to the playboy prince. One Briton tweeted that he has no issue with Prince Harry having fun, but “I do object to having to foot the bill for it.” Local newspaper columnist Rod McPhee wondered, “Was it a small, medium or large sized town of tax payers who paid for Prince Harry’s bar tab in Vegas?”

A beloved monarch

Recent controversy aside, Juan Carlos has long been one of Europe’s most popular royals. It is not unusual to find Spaniards who say they are anti-monarchy but pro-Juan Carlos. Handpicked by the dictator Francisco Franco to be his successor, Juan Carlos instead steered the country toward a parliamentary monarchy after Franco died in 1975.

But his reputation has taken a hit in recent months because of three separate scandals.

First, the king’s son-in-law, Inaki Urdangarin — a three time Olympian in handball who is married to Princess Cristina and lives in the Washington area with his family — in February became the first royal in modern history to be questioned by a court when he was ordered to appear to answer accusations that he embezzled public funds. A few months after that, Juan Carlos’s eldest grandson, who is 13, misfired a small 36-caliber shotgun and wound up shooting himself in the foot — despite the fact that children that age are prohibited under Spanish law from using firearms.

Then, of course, there was the elephant incident.

The king had tried to keep the April trip secret, but word leaked out when he fell and had to be rushed home to undergo hip replacement surgery. When he left the hospital, he apologized to the country.

In late July, Juan Carlos was humbled again. The king, who was Spain’s honorary president of the World Wildlife Fund, was stripped of his title after the group’s members circulated a petition calling his hunt “unethical.”

Members of parliament are demanding full transparency of the monarchy’s expenditures, especially after it was revealed that a foreign businessman funded part of the Botswana trip. The lawmakers are saying the king, just like any other public official, should be required to disclose trips, explain costs and report what countries or companies helped defray expenses.

Jose Luis Centella, a spokesman for the United Left party, said it is drafting legislation it will introduce in September that would give the king the same legal status as any other citizen so that he could be put on trial and held accountable for issues. “Right now he’s untouchable and that is not how it should be for a modern state,” Centella said in an interview.

While the king’s popularity has fallen in public opinion polls, many Spaniards said they still stick by him.

“It’s ridiculous how big of a deal they made about the hunting trip,” said Maria Teresa Ruiz, 81, whose family owns a flower shop in Madrid. “The king has been hunting since he was a teen.”

Patricia Velilla, 21, a college junior, said she still loves Juan Carlos but wondered whether the recent controversy would mean that Juan Carlos’ son, Crown Prince Felipe, 44, would no longer be able to ascend to the throne: “At the moment the king changes, it will be an issue. Many people may go to the streets and say they don’t want a king anymore.”

Juan Diez Nicolas, who has studied public opinion in Spain for 30 years, said, “I think the king has been such a marvelous protagonist of the Spanish transition that I don’t see all that excitement about hunting an elephant hurting him too much in the long run.”

The king’s pay cut

For his part, Juan Carlos is not taking the public’s support for granted.

Like other heads of state in parliamentary monarchies, Juan Carlos receives a constitutionally mandated annual grant from the state to help carry out his official duties. The budget includes salaries for staff and other office expenses. The government also pays for the upkeep of his palaces and other royal sites.

The king also receives a salary and — in a very public display — announced in late July that he would be taking a voluntary 7 percent pay cut in his salary in solidarity with other civil servants. He now makes $334,000 while his son, Crown Prince Felipe, will make $160,000. In contrast, President Obama’s salary is $400,000 a year.

In August, the Spanish king quietly canceled his usual month-long holiday with his children and grandchildren aboard the family yacht in Majorca. The trip had been a high-point in the year for the paparazzi for as long as anyone could remember. Instead, Juan Carlos is staying in the capital city along with everyone else who cannot afford a vacation.

“He is working hard to convince people that he is aware of the pain lots of people are experiencing and he is trying to trim his act and thereby giving the impression that he is in touch with people’s concerns,” said Charles Powell, a British historian and author of a biography of the Spanish king.

For all the uproar about Juan Carlos’s spending, Spain’s monarchy is Western Europe’s cheapest, at least according to official figures.

In his sixth annual study, Matthijs found that the Spanish head of state’s cost to taxpayers was between $11 million and $12.3 million last year. More than 500 people are on the royal household payroll. Nearly half of the royal budget goes toward those personnel costs. Another 40 percent goes to operating expenses.

In contrast, the Dutch royal family cost the Netherlands $48.5 million last year and austerity measures have brought the cost of the British monarchy down to $47 million.

But Matthijs cautions that some of the costs of monarchies are hidden because they are rolled into foreign ministry or security budgets. The left-leaning Spanish newspaper El Publico estimated in December that the true cost of the monarchy was astronomically more — close to $74 million.