A Saudi prince who was one of dozens arrested as part of a purported “anti-corruption” campaign can buy his way out of detention — if he pays an astonishing $6 billion fine, according to a report.

Saudi Prince al-Waleed bin Talal, one of the wealthiest men in the world, was among the dozens of royals and business people detained last month in what the Saudi government says was a crackdown on corruption by Crown Prince Mohammed bin Salman, according to the Wall Street Journal.

Many of those arrested have already been released after negotiating settlements, the newspaper reported.

Prince al-Waleed is estimated to be worth $18.7 billion, making him the wealthiest person in the Middle East.

But the mogul suggested he’d have to dismantle his financial empire to raise the $6 billion for his release — and is discussing giving away a piece of his company, the Kingdom Holding Company, to the Saudi government instead of forking over the cash, according to the paper.

“Keeping [the empire] under his control, that’s his battle,” a source said.

The prince faces allegations of money laundering, bribery and extortion, according to a senior Saudi official.

But a lawyer who’s worked with al-Waleed said “there are no formal accusations” against him.

“He wants a proper investigation. It is expected that al-Waleed will give MBS [the crown prince] a hard time,” a person close to the prince told the Wall Street Journal.

Many of those arrested have been staying at a Ritz Carlton in Riyadh, while some have digs at other five-star hotels across the capital.