SANTA ANA, CALIF. -- A federal judge revoked bail Wednesday for attorney Michael Avenatti after prosecutors detailed evidence of new financial crimes he committed while he was free and facing trials in New York and California.

Judge James Selna said Avenatti, best known as the brash lawyer for porn actress Stormy Daniels, likely committed the crimes and was a threat because of the prospect he would continue committing crimes while free.

"I believe the danger to the community is real and palpable," Selna said in court.

Prosecutors described 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 $20 million, prosecutors said. After receiving the money, he even sought legal representation from a public defender while declining to provide a financial affidavit his ability to afford a lawyer.

Defence lawyers contested the evidence, saying Avenatti didn't hide funds, has been paying his bills and posed no threat.

"It's just making it so that he doesn't make it easier for creditors," attorney H. Dean Steward said. "I suggest it doesn't go over the line."

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 defence counsel in a very difficult position."

Gardephe said he would consider postponing the case after he learned the outcome of the bail hearing in Santa Ana, California.

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 Los Angeles courthouse, according to the Daily Beast.

Prosecutors were seeking to hold Avenatti behind bars for allegedly committing new acts of wire and mail fraud, both federal offences, 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 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 the proceeds of a book deal.

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.

------

Melley reported from Los Angeles. Associated Press writer Larry Neumeister reported from New York.