NEW YORK - Bankrupt crypto exchange FTX may sell its shares in artificial intelligence startup Anthropic, a U.S. judge ruled Thursday.

U.S. Bankruptcy Judge John Dorsey in Wilmington, Delaware approved FTX's proposal to sell the shares after FTX reached a compromise in court with a group of FTX customers that had opposed the sale.

FTX invested $500 million in Anthropic in 2021, and currently holds a 7.84 percent stake in the company, according to court documents. The company had sought permission to sell the shares as part of its court-supervised effort to liquidate its assets and repay customers who lost access to their accounts when the company collapsed in 2022.

"We are selling the Anthropic shares, as we are selling everything, and putting the money in the bank," FTX attorney Andy Dietderich said at a Thursday court hearing.

FTX expects to sell the shares at a profit, and it will retain flexibility to sell its shares at the "most optimal and appropriate time," according to court documents.

"Given the increased interest in AI and large language models, there has been significant appreciation in the value of the Anthropic Shares since the Debtors' acquisition and investment in Anthropic in 2021," FTX wrote in a Feb. 3 court filing.

FTX's 2021 investment initially gave it a 13.56% equity stake in Anthropic. The FTX stake has been diluted by the company's subsequent fundraising, which includes a $4 billion investment from Amazon.com.

The customers that opposed the sale had argued that FTX did not actually own the Anthropic shares, because they were purchased with funds embezzled from FTX customers' deposits. But they agreed Thursday to allow the sale to go forward, as long as they are allowed to argue later that FTX customers own any money generated from the future sale.

Dietderich said that FTX already intends to repay customers using the sale proceeds, and it has enough cash to repay any specific group of customers that can convince a court that they owned the Anthropic shares. FTX currently has $6.4 billion in cash, Dietderich said.

FTX expects to pay all customers in full, although it will calculate their repayment based on cryptocurrency prices from November 2022, when FTX filed for bankruptcy amid a prolonged slump in the crypto market, rather than at the present, higher value of crypto assets.

FTX founder Sam Bankman-Fried was found guilty of stealing billions from customers on Nov. 2, in one of the biggest financial frauds on record. Bankman-Fried's sentencing is March 28, and he is expected to appeal his conviction.

(Reporting by Dietrich Knauth, Editing by Alexia Garamfalvi, William Maclean)