NEW YORK — Michael Avenatti — who made headlines representing an adult-film actress who claimed an affair with Donald Trump before he was president — was sentenced to 30 months in prison on Thursday, after offering a sobbing plea for mercy for trying to extort Nike Inc.

The disgraced celebrity lawyer was convicted in February 2020 of fraud and attempted extortion for his efforts to shake down Nike for as much as $25 million during what he said was a negotiation for his client, a youth basketball coach. A jury found that he threatened to expose alleged wrongdoing within the company if it did not meet his demands to settle.

"Mr. Avenatti had become drunk on the power of his platform, or what he perceived the power of his platform to be. He had become someone who operated as if the laws and rules which apply to everyone else didn't apply to him," said U.S. District Judge Paul G. Gardephe.

The judge excoriated Avenatti for his conduct, but gave him a big break on what could have been a nine-to-11-year sentence. In explaining his decision, Gardephe questioned the Justice Department's decision not to charge another lawyer from California, Mark Geragos. The two attorneys, once staples of cable television news, played a "good cop, bad cop" routine on Nike, Gardephe said.

Geragos, the judge said, "suffered no consequences as a result of his conduct and he was a central figure in the criminal conduct." Geragos did not respond to a message seeking comment.

Before being sentenced, Avenatti wept talking about his fall. "TV and Twitter, your honor, mean nothing," he said. "I and I alone have destroyed my career, my relationships, my life, and there is no doubt that I deserve to pay, have paid, and will pay a further price for what I have done." He hopes his children will be ashamed of him, he said, "because if they are ashamed it means their moral compass is exactly where it should be."

The extortion case emerged out of Avenatti's representation of the youth basketball coach, Gary Franklin, who didn't know Avenatti was using his name to try to negotiate a hefty payday with the athletic apparel giant.

The judge quoted Avenatti's own profanity-laced demands at length, saying the lawyer was willing to abandon his client's interests to get money for himself. According to recordings played at his trial, Avenatti insisted that the company pay him and Geragos millions of dollars to investigate internal wrongdoing. If not, he said, he would hold a news conference and expose what he knew.

Prosecutors sought a prison sentence of more than 10 years, while Avenatti’s lawyers had suggested a jail sentence of six months. “He lost his way and he knows it,” his defense lawyer Danya Perry said. “He’s a completely humbled man who’s been beaten down. . . . He’s had an epic fall and he’s been publicly shamed.”

Avenatti faces additional potential punishment, including a separate pending indictment in the same Manhattan courthouse on charges he defrauded other clients. Among them is adult-film star Stormy Daniels, who claimed to have had a one-night sexual encounter with Trump. That trial is scheduled for next year.

During the 2016 presidential campaign, Daniels was paid for her silence by Michael Cohen, who at the time was Trump’s attorney. Trump has denied having such an encounter with Daniels or knowing about the payoff.

Assistant U.S. Attorney Matt Podolsky said Avenatti — who explored running for president as a Democrat in 2020 — tried to create the impression that he had wandered across a thin legal line as a hard-nosed lawyer. But the extortion case, the prosecutor said, was clear-cut and brazen.

“He has repeatedly described this case as about negotiations, as about some thin line . . . that he may have crossed accidentally,” Podolsky said. “That’s not what this case is about . . . it was about deceit, it was about threats, it was about taking from others, and it was about abuse of trust.”

Avenatti served more than three months in jail, including in solitary confinement, before his release to home confinement last year because of the coronavirus pandemic. His attorneys wrote in a presentencing memo that he was convicted of “non-violent offenses that caused no direct loss to either Nike or Coach Franklin.”

Avenatti showed a knack for using his notoriety as a critic of Trump to take on high-profile cases and clients. In 2018, as Brett M. Kavanaugh was being considered for a spot on the Supreme Court, Avenatti represented a woman who claimed to have been a victim of sexual misconduct years earlier by Kavanaugh — a claim Kavabaugh denied.