“In the short run, it has worked, by generating some assets and consolidating his power, and it has been popular in a way that could offset some of the anger over austerity measures,” said Steffen Hertog, a professor at the London School of Economics, describing Prince Mohammed’s gambit. “But in the mid- to long term, I think confidence in the private sector has taken a hit, and this could be difficult to rebuild.”

The entire process, from the initial arrests through the detentions, has been shrouded in such secrecy that it remains unclear exactly who was taken into custody, what they were accused of, and what sort of deals they had to strike to get out.

But interviews with more than a dozen people, most of whom spoke on condition of anonymity to avoid provoking the prince, have pulled back the curtain on some details of the arrests and the detainees’ time in their five-star jail.

It started with a storm of phone calls from the Royal Court.

In early November, princes, businessmen and government ministers were invited to dinner with King Salman or to meetings with Prince Mohammed. Others were handcuffed in their homes and dragged off like criminals. All were detained, and most landed in what became the world’s most luxurious prison.

The Riyadh Ritz-Carlton stands behind high walls and ornate gates, across a freeway from the diplomatic district. The hotel has long welcomed distinguished guests, and when President Trump and his family stayed there in May, American and Saudi flags were projected on its facade.

The hotel’s new guests — or inmates — received a cooler welcome.

Each got his own room, but had to leave the door open, with guards posted outside. The detainees could order room service and watch TV, but they had no phones or internet, to prevent appeals for help. The rooms were still lavish, but their curtain cords and glass shower doors had been removed to prevent suicide attempts. They were not allowed to summon lawyers, who might have been able to help, and many succumbed to being stripped of their substantial assets.

Many of the detainees were overweight or had health problems, and some were in their 70s, so a doctor noted their medical needs. Since none had packed for an extended stay, a tailor came, took their measurements and soon brought them new outfits.