A chastened Michael Avenatti, the brash lawyer who once represented Stormy Daniels in lawsuits against President Donald Trump, was sentenced Thursday to 2 1/2 years in prison for trying to extort up to $25 million from Nike by threatening the company with bad publicity.

Avenatti, 50, rose to prominence by sparring publicly with Trump, but criminal fraud charges on two coasts disrupted his rapid ascent. He was convicted last year of attempted extortion and other charges in connection with his representation of a Los Angeles youth basketball league organizer who was upset that Nike had ended its league sponsorship.

U.S. District Judge Paul G. Gardephe called Avenatti’s conduct “outrageous,” saying he “hijacked his client’s claims, and he used those claims to further his own agenda, which was to extort millions of dollars from Nike for himself.”

Avenatti, the judge added, “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 the rules that applied to everyone else didn’t apply to him.”

Before the judge spoke, Avenatti delivered emotional remarks. He choked up several times and spoke at times through tears, saying, “I and I alone have destroyed my career, my relationships and my life.”

“Your honor, I’ve learned that all the fame, notoriety and money in the world is meaningless. TV and Twitter, your honor, mean nothing,” he said.

He ended his statement by saying what he expects of his three children, including two teenage daughters who wrote letters to the judge.