Michael Avenatti, who was arrested in California on accusations that he violated the terms of his bail, is to remain in federal custody and be transported to New York to stand trial in a separate case, a judge ordered Wednesday.

Mr. Avenatti was arrested Tuesday after prosecutors said that he defrauded and concealed money from creditors while on bail for similar charges from last year.

In that case, Mr. Avenatti is accused of stealing millions of dollars from clients and of lying about his business and income to an I.R.S. collection agent, creditors and a bankruptcy court, among others. In March, he was arrested and released.

But prosecutors in California said in court filings made public Wednesday that Mr. Avenatti had violated the conditions of his bail by continuing to engage in criminal activity. They asked that Mr. Avenatti be kept in federal custody ahead of a trial that was slated to begin in May, a request that Judge James V. Selna granted.