Two sons of Saudi Arabia's late King Abdullah have been released from detention at Riyadh's Ritz-Carlton hotel, days after nearly two dozen other detainees in the kingdom's two-month-old anti-corruption campaign were also freed.

Saudi Arabia's attorney general approved the release of Prince Meshaal bin Abdullah and Prince Faisal bin Abdullah after they reached financial settlements with the government, a senior Saudi official with knowledge of the matter told Reuters.

The source did not elaborate on the settlements.

Scroll down for video:

Prince Meshaal bin Abdullah and Prince Faisal bin Abdullah were held at the Ritz-Carlton hotel in Riyadh

The crack down on corruption was also widely seen as helping Crown Prince Mohammed bin Salman (pictured) consolidate his grip on power, after he ousted his cousin as heir to the throne in the summer.

The attorney general had not yet reached a decision on whether to release a third brother, Prince Turki bin Abdullah, the source said.

A related member of the royal family, Princess Nouf bint Abdullah bin Mohammed bin Saud, tweeted photos of the two princes and exclamations of thanks on Thursday.

Saudi security forces rounded up some 200 princes, ministers and business leaders and converted the Ritz-Carlton into a luxurious prison for them in early November in what Riyadh said was a crackdown on corruption.

Prince Miteb bin Abdullah was released last month after agreeing to pay the government $1 billion

The move was also widely seen by analysts as helping Crown Prince Mohammed bin Salman consolidate his grip on power, after he ousted his cousin as heir to the throne in the summer.

The most powerful of King Abdullah's sons, former National Guard chief Prince Miteb bin Abdullah, was released last month after agreeing to pay the government $1 billion.

Prince Miteb had been the last member of Abdullah's Shammar branch of the family to retain a key position in the Saudi power structure, after Prince Meshaal and Prince Turki were relieved of their posts as governors in 2015.

Saudi newspaper Okaz reported on Tuesday that 23 individuals had been released after reaching deals with the government and that more were expected to follow in the days ahead.

Others who had not reached settlements would face trial, the report said.