Michael Avenatti, the attorney who rose to prominence as the legal counsel for adult-film actress Stormy Daniels during her lawsuit against President Trump over a hush-money deal, will remain in jail following his rearrest by IRS agents, a judge in Los Angeles ruled Wednesday after prosecutors alleged he continued to commit financial crimes while out on bail.

Avenatti — who is accused of extorting athletic apparel maker Nike for up to $25 million and stealing millions of dollars from those he once represented, including Daniels — was arrested Tuesday evening while appearing before the State Bar Court in Los Angeles, in the middle of a disciplinary hearing alleging he stole about $840,000 from a former client.

Prosecutors alleged in court filings made public Wednesday that Avenatti had “brazenly attempted” to hide his money and defraud people and entities to whom he was millions of dollars in debt — including a former law partner he owed $5 million, a former client he owed $2.2 million, and an ex-wife he owed $2.5 million in spousal and child support.

“The fact that defendant continued to engage in criminal conduct after he had been indicted in this case and while on bond demonstrates that defendant remains a substantial economic danger to the community,” prosecutors wrote.

Avenatti is facing federal charges on both coasts in connection with myriad fraud allegations, though he had been allowed to remain free on bond. Prospective jurors in the first of his scheduled trials, having to do with the Nike allegations, were supposed to show up at federal court in New York next week to begin the process of seeing who could serve on his case. But after two phone conferences Wednesday, Judge Paul G. Gardephe temporarily postponed the trial and asserted that Avenatti’s arrest “has essentially thrown the trial into chaos.”

A federal judge in California ordered that Avenatti remain in federal custody, though he is expected to be transported by Friday to New York for proceedings there. Gardephe said he hoped the trial could begin no later than Jan. 27 and scheduled a status conference in the case for Tuesday.

Avenatti’s defense attorneys expressed concern that they were unsure whether he could now make any financial commitments related to the upcoming trial, such as paying for witness travel of hired experts. They said Avenatti might need to apply to the court for resources as an indigent defendant.

“We were dealing with very little resources, and now we have none,” defense attorney Jose Quinon said, noting that in light of the allegations in California, he could not advise Avenatti to spend money on his trial. “It’s like going to war without weapons on our side right now.”

The Daily Beast reported Avenatti was taken into custody during a break in testimony at the State Bar Court, where officials were considering professional discipline against the controversial attorney.

Walking out of the courthouse on Tuesday around 6 p.m., the attorney, known for his antagonism toward the president, only had a couple words to offer, the Daily Beast reported.

“Completely innocent,” Avenatti said.

Steven E. Bledsoe, a Los Angeles lawyer representing Gregory Barela, the man who claims Avenatti stole hundreds of thousands of dollars from his lawsuit settlement, told The Washington Post that Avenatti was “digging himself an even bigger hole on the witness stand” in the State Bar proceeding before his sudden arrest.

“It is unfortunate that Mr. Avenatti’s arrest will delay the State Bar disciplinary proceedings, but it appears that losing his law license will be among the least of his worries,” Bledsoe said.

In court documents made public Wednesday, federal prosecutors in Los Angeles alleged that Avenatti gave money to an associate, who later gave a portion back, and arranged for an ex-wife to buy a Mercedes-Benz that he used, so he could avoid having to pay back debts he owed. Prosecutors also alleged that Avenatti drained his bank accounts of money by putting the funds into cashier’s checks, which he would briefly redeposit to access funds before draining the accounts again.

“By doing so, defendant was clearly attempting to limit his creditors’ ability to levy his accounts and recover the debts defendant owed to his creditors,” prosecutors wrote.

Prosecutors also accused Avenatti of a crime known as “structuring” — withdrawing money from a bank in increments less than $10,000 to avoid the transactions being reported to the government. They said his misdeeds continued from April 2019 to October — long after he was first indicted in California.

Avenatti’s attorneys said on the conference calls Wednesday that they had not yet had occasion to talk to Avenatti. In seeking to keep the New York trial on track, federal prosecutor Matthew D. Podolsky said that his team had not sought to freeze any of Avenatti’s assets because of the new allegations in California and that Avenatti had the same money after the arrest that he did before. Quinon countered that vendors Avenatti might pay for the trial might want to be assured they would not face legal problems for taking Avenatti’s money, and he could not give them that.

The judge said he was sympathetic to that argument, because, he said, prosecutors had raised concern that Avenatti’s funds were “tainted.” He testily told Podolsky he did not understand why prosecutors in Los Angeles had, only on the eve of a New York trial, chosen to arrest Avenatti on allegations from last year.

“That’s created enormous disruption, and unless the parties cooperate effectively, I really have no idea when this is going to get tried,” Gardephe said.

Avenatti’s financial condition, including his expensive spending habits, has become a point of contention in his coming federal trial. His lawyers dispute the government’s claim that his debt reached more than $15 million, while prosecutors say his financial woes were the catalyst for him allegedly threatening Nike when he did.

In that case, the attorney allegedly demanded millions in hush money regarding claims about the sports apparel behemoth paying high school basketball players to direct them toward college basketball programs sponsored by Nike. The company has denied any wrongdoing.

New York federal prosecutors have separately accused Avenatti of stealing about $300,000 from Daniels in connection with a book deal she signed. He is scheduled for trial in that case in April. Federal prosecutors in Los Angeles allege he defrauded other clients, and his trial in that case is scheduled for May.

The attorney has pleaded not guilty to the charges in both New York and California. Avenatti no longer represents Daniels, who alleged she had a sexual encounter with Trump and was paid to keep quiet about it during the 2016 presidential campaign. Her real name is Stephanie Clifford. The president has denied her allegations.