LOS ANGELES — Michael Avenatti, the brash former attorney for the porn actress Stormy Daniels, was arrested for allegedly violating bail conditions by committing numerous crimes to hide assets from creditors while living a lavish lifestyle, U.S. prosecutors alleged in a court document released Wednesday.

Avenatti was arrested by IRS agents at a state bar court hearing Tuesday, where he was facing suspension of his license to practice for allegedly stealing from a client, said Thom Mrozek, spokesman for the Los Angeles U.S. Attorney’s office. He was collared during a break in his testimony.

"Completely innocent," Avenatti said as he was being led out of the courthouse, according to the Daily Beast.

The new twist in a saga that spans from coast to coast threatens to disrupt Avenatti's trial scheduled next week in Manhattan on charges he tried to extort $25 million from Nike, a New York federal judge said during a hearing Wednesday.

"The arrest of Mr. Avenatti this close to the trial has essentially thrown the trial into chaos," U.S. District Judge Paul G. Gardephe said. “Mr. Avenatti has been on bail in the California case for a long time. So there are certainly questions in my mind about why it was necessary to raise allegations about bail violations so close to the trial and it certainly has put defense counsel in a very difficult position.”

Court documents supporting Tuesday's arrest lay out several schemes orchestrated by Avenatti to hide his assets from an ex-wife, a former legal partner and a client, while living in an $11,000-a-month apartment, being chauffeured in a Mercedes and staying in luxury resorts.

He pocketed $1 million in legal fees during the period and then shifted the money around to conceal the payment despite mounting debts that surpassed $10 million, prosecutors said. After receiving the money, he even sought legal representation from a public defender while declining to provide a financial affidavit to show he couldn't afford a lawyer.

Prosecutors are seeking to hold Avenatti behind bars before trial for allegedly committing new acts of wire and mail fraud, both federal offenses, as well as possible state crimes in California and Washington state. Avenatti had been free on an unsecured $300,000 surety bond that required he not commit any crimes.

The alleged new crimes follow a pattern of misconduct since 2011 and appear to mirror crimes he is charged with committing in a 36-count indictment, prosecutors said.

"Defendant’s extensive pattern of criminal conduct and the overwhelming evidence supporting those charges demonstrate that defendant is a substantial danger to the community,” prosecutors wrote in a court document. “If allowed to remain on bond, defendant will almost certainly continue to engage in further fraudulent and obstructive conduct.”

Avenatti was scheduled to appear in federal court in Santa Ana, California, late Wednesday morning. His defense lawyer did not immediately reply to requests for comment.

Avenatti faces trial in May in California for dozens of charges alleging he defrauded clients of millions of dollars, stiffed the IRS and committed bank fraud.

He has pleaded not guilty to those charges, along with the Nike extortion allegations and a separate case charging him with ripping off ex-client Daniels of proceeds of a book deal. Gardephe said he would decide what to do about scheduling the Nike case after Avenatti's bail hearing in California.

The arrest of Avenatti marks a new low for the attorney who was flying high a year ago while in the spotlight championing Daniels' case against President Donald Trump.

Daniels, whose real name is Stephanie Clifford, went to court to tear up a $130,000 hush money deal she said she made to cover up an affair with Trump before he was president.

Although Trump has denied the affair, he chose not to challenge that effort, so she effectively won what she was seeking. But the president won his legal fees in successfully challenging a related defamation case Daniels brought against him.

Avenatti had positioned himself as a Trump troll of sorts, attacking the president on Twitter frequently, and even flirted with running for president at one point, making appearances in Iowa and New Hampshire.

Despite losing the Daniels defamation case, Avenatti had claimed he would eventually prevail and win her even larger lawyer fees than the nearly $300,000 she owed Trump. But Daniels hired a new lawyer to take the case, and Avenatti's own criminal legal problems began with his arrest in New York in March.

While free on bond, prosecutors said Avenatti funneled $717,000 from his $1 million in legal fees to an account his first wife set up. She then returned $500,000 to him and used some of the remaining balance to buy her ex-husband a used Mercedes for $50,000.

Avenatti maintained his membership at Exclusive Resorts, a Colorado-based company billed as as the “world's elite private vacation club,” according to prosecutors. He paid over $35,000 to the club last summer and stayed at their resorts four times in California, Florida and New York between August and November.

His girlfriend, who is not named in the court papers, also stayed as his guest at one at an Exclusive Resort in Tuscany, Italy, prosecutors said.