NEW YORK - Sam Bankman-Fried and other FTX executives received billions of dollars in secret loans from the crypto mogul's Alameda Research, the hedge fund's former chief told a judge when she pleaded guilty to her role in the exchange's collapse.

Caroline Ellison, former chief executive of Alameda Research, said she agreed with Bankman-Fried to hide from FTX's investors, lenders and customers that the hedge fund could borrow unlimited sums from the exchange, according a transcript of her Dec. 19 plea hearing that was unsealed on Friday.

"We prepared certain quarterly balance sheets that concealed the extent of Alameda's borrowing and the billions of dollars in loans that Alameda had made to FTX executives and to related parties," Ellison told U.S. District Judge Ronnie Abrams in Manhattan federal court, according to the transcript.

Ellison and FTX co-founder Gary Wang both pleaded guilty and are cooperating with prosecutors as part of their plea agreements. Their sworn statements offer a preview of how two of Bankman-Fried's former associates might testify at trial against him as prosecution witnesses.

In a separate plea hearing, also on Dec. 19, Wang said he was directed to make changes to FTX's code to give Alameda special privileges on the trading platform, while being aware that others were telling investors and customers that Alameda had no such privileges.

Wang did not specify who gave him those directions.

Nicolas Roos, a prosecutor, said in court on Thursday that Bankman-Fried's trial would include evidence from "multiple cooperating witnesses." Roos said Bankman-Fried carried out a "fraud of epic proportions" that led to the loss of billions of dollars of customer and investor funds.

Bankman-Fried has acknowledged risk-management failures at FTX but said he does not believe he has criminal liability. He has not yet entered a plea.

Bankman-Fried founded FTX in 2019 and rode a boom in the values of bitcoin and other digital assets to become a billionaire several times over as well as an influential donor to U.S. political campaigns.

A flurry of customer withdrawals in early November amid concerns about commingling of FTX funds with Alameda prompted FTX to declare bankruptcy on Nov. 11.

Bankman-Fried, 30, was released on Thursday on $250 million bond. His spokesperson declined to comment on Ellison and Wang's statements.

Lawyers for Wang and Ellison declined to comment.

Ellison told the court that when investors in June 2022 recalled loans they had made to Alameda, she agreed with others to borrow billions of dollars in FTX customer funds to repay them, understanding that customers were not aware of the arrangement.

"I am truly sorry for what I did," Ellison said, adding that she is helping to recover customer assets.

Wang also said he knew what he was doing was wrong.

The transcript of Ellison's hearing was initially sealed out of concern that the disclosure of her cooperation could thwart prosecutors' efforts to extradite Bankman-Fried from the Bahamas, where he lived and where FTX was based, court records showed.

Bankman-Fried was arrested in the capital Nassau on Dec. 12 and arrived in the United States on Wednesday after consenting to extradition.

A magistrate judge ordered him confined to his parents' California home until trial.

On Friday evening, Abrams recused herself from the case, saying in a court order that the law firm Davis Polk & Wardwell LLP, where her husband is a partner, advised FTX in 2021.

The firm also represented parties that could be adverse to FTX and Bankman-Fried in other proceedings, the judge said, and while her husband had no involvement in these matters, which "were confidential and their substance is unknown to the Court," she was recusing herself to avoid a possible conflict.

(Reporting by Luc Cohen in New York; Writing by Tom Hals in Wilmington, Del.; Editing by Noeleen Walder, Matthew Lewis and Daniel Wallis)