Michael Avenatti, a high-profile attorney and critic of President Trump, was arrested in New York on Monday and charged in what prosecutors called a brazen bid to extort millions of dollars from Nike by threatening to damage the company’s image.

Simultaneously, federal prosecutors in Los Angeles filed separate charges accusing Avenatti of wire fraud and bank fraud, alleging that he took a client’s settlement money and used it to cover costs related to Avenatti’s coffee shop business and other personal expenses. Avenatti is accused of concealing from the client where the money was.

FBI officials said Avenatti, 48, was arrested in Manhattan on Monday as he arrived at the offices of Boies Schiller, the law firm representing Nike. He had gone there for a meeting about his demands, officials said. Monday evening, a federal magistrate judge in New York ordered Avenatti released on $300,000 bond.

Geoffrey Berman, the U.S. attorney in Manhattan, said that Avenatti dressed up the alleged demands as legal negotiations but that he still broke the law.

“A suit and tie doesn’t mask the fact that, at its core, this was an old-fashioned shakedown,” Berman said. “When lawyers use their law licenses as weapons, as a guise to extort payments for themselves, they are no longer acting as attorneys. They are acting as criminals.”

The charges mark the latest and most remarkable chapter in the strange public saga of the California lawyer who had represented Stormy Daniels, an adult-film actress paid to keep quiet during the 2016 presidential campaign about her alleged affair with Trump several years ago. At the height of his attacks on Trump’s integrity, Avenatti considered running for president before opting against it late last year.

That case catapulted Avenatti to cable-news fame, but prosecutors now say he threatened to use that platform to commit a crime. Avenatti did not respond to requests for comment. Leaving a New York courthouse Monday evening, he said he would be “fully exonerated” and “justice will be done.”

Authorities charge that Avenatti threatened to hold a news conference on the eve of the NCAA college basketball tournament to reveal damaging allegations against Nike unless it paid his client $1.5 million and agreed to hire Avenatti and another lawyer for $15 million to $25 million to conduct an “internal investigation” into the purported allegations.

“Nike will not be extorted or hide information that is relevant to a government investigation,” the company said in a statement. “Nike firmly believes in ethical and fair play, both in business and sports, and will continue to assist the prosecutors.”

The charging document said Avenatti proposed another alternative to hiring him to conduct an investigation: “a total payment of $22.5 million from Nike to resolve any claims [the client] might have and additionally to buy Avenatti’s silence.”

Shortly before the charges were unsealed Monday, Avenatti tweeted that he planned to hold a news conference Tuesday “to disclose a major high school/college basketball scandal perpetrated by @Nike that we have uncovered. This criminal conduct reaches the highest levels of Nike and involves some of the biggest names in college basketball.”

According to a criminal complaint filed by an FBI agent, Avenatti and the other lawyer approached Nike last week, the first in a series of contentious discussions. Court papers identify the other lawyer only as “co-conspirator 1,” but people close to the investigation who spoke on the condition of anonymity said Avenatti was working with Mark Geragos.

Geragos, whose law firm declined to comment, is a high-profile television personality and celebrity lawyer. His clients have included Michael Jackson, Chris Brown and Jussie Smollett, the “Empire” actor recently accused of fabricating a story about a racist attack.

Geragos has not been charged with a crime.

Last week, prosecutors said, Avenatti told Nike that if the demands were not met, “I’ll go take ten billion dollars off your client’s market cap. . . . I’m not f-----g around,” according to the complaint.

Avenatti claimed that his client “had evidence that one or more Nike employees had authorized and funded payments to the families of top high school basketball players and/or their families and attempted to conceal those payments,” the complaint said.

Prosecutors said Avenatti threatened to expose Nike to the kind of controversy that has plagued competitor Adidas. In October, two Adidas officials were convicted of fraud in federal court for secretly paying the families of several top basketball recruits to secure their commitments to college teams sponsored by the German company.

In wiretapped phone calls and text messages introduced during their trial, the Adidas officials spoke of their belief that Nike arranged similar payments to steer top athletic recruits.

In its statement Monday, Nike said it has been cooperating with that federal investigation for more than a year.

After Avenatti brought his alleged demands to Nike last week, the Boies Schiller lawyers responded by calling federal prosecutors.

Federal agents arranged to secretly record subsequent conversations during which, they say, Avenatti demanded money not just for his client but also for himself.

The charges in the New York case are extortion, extortion conspiracy, transmission of interstate communications with intent to extort, and conspiracy to transmit interstate communications with the intent to extort.

At one point in the secretly recorded negotiations, a Boies Schiller lawyer noted that he had never been paid the kind of money by Nike that Avenatti was demanding, court documents say. Prosecutors say Avenatti responded by asking whether the lawyer had ever “held the balls of the client in your hand where you could take five to six billion dollars’ market cap off of them?”

In the California case, Avenatti is accused of misusing client funds and of lying to a bank about his income to obtain loans totaling $4.1 million for his law firm and coffee business.

According to court papers, Avenatti negotiated in January a $1.6 million settlement on behalf of an unidentified client, but prosecutors say he gave that client a bogus settlement agreement with a false payment date, concealing what he had done.

As part of a long-running investigation into Avenatti’s alleged financial misdeeds, officials said he did not pay taxes for several years and owed the Internal Revenue Service $850,438, plus interest and penalties.

“There have been collection efforts going on for many, many years,” said Nick Hanna, the U.S. attorney in Los Angeles. “This investigation was started in the ordinary course; it came up through the IRS with the collection of back taxes.”

Hanna said the Avenatti case “has nothing to do with anything political or with anything else. The facts in this case speak for themselves.”

Daniels, whose real name is Stephanie Clifford, dropped Avenatti as her lawyer earlier this year. In a statement issued after his arrest, she said she was “saddened but not shocked” by reports he had been charged. Avenatti, she said, “dealt with me extremely dishonestly.”

Avenatti shot to prominence one year ago after he began representing Daniels in a lawsuit to void her 2016 nondisclosure agreement with Trump over a one-night stand she claims they had 10 years earlier. Trump denies her allegations of an affair.

Over the course of nine months, Avenatti styled himself as Trump’s chief legal adversary and threatened to challenge the president as a Democrat in the 2020 election. His brashness on Twitter and cable TV, where he taunted Trump and Trump’s lawyers, won support from some liberals.

Avenatti defended his approach amid criticism from some in the legal and political worlds. “We’ve been aggressive, but I also think we’ve been strategic and thoughtful, and without that approach, we wouldn’t be where we are now. We’ve created a situation where the other side continues to make mistake after mistake,” he told The Washington Post in May.

Avenatti courted controversy by representing Julie Swetnick, one of the women who accused now-Supreme Court Justice Brett M. Kavanaugh of misconduct. Senate Judiciary Committee Chairman Charles E. Grassley (R-Iowa) later claimed that Avenatti and Swetnick made “materially false” statements to his panel and referred them to the Justice Department.

Based in Newport Beach, Calif., Avenatti was known for his success in a handful of large class-action lawsuits, financial disputes with partners at his former law firm, and allegedly dubious business practices involving his onetime ownership stake in Tully’s, a now-defunct Seattle-based coffee chain. Avenatti has denied wrongdoing in the latter two cases.

While representing Daniels, he brought multiple actions against the president and his former attorney Michael Cohen, among others. One suit accused Trump of defamation after the president suggested Daniels was perpetrating a “con job” when she said she was threatened not to speak about their alleged affair. A federal judge dismissed the suit in October.

In November, Avenatti was arrested in Los Angeles on suspicion of domestic violence. Prosecutors declined to charge him.

A few days later, a judge evicted his law firm after it failed to pay more than $213,000 in rent. Avenatti called the decision “ridiculous” and said it involved his “old firm, which was already in the process of moving.”

Stephen Gillers, a New York University professor and expert on legal ethics, said Avenatti is more show than substance.

“I was always uncomfortable with his claims and astonished at the amount of airtime he got,” Gillers said.

Will Hobson contributed to this report.