LOS ANGELES (AP) — Michael Avenatti seemingly came out of nowhere, a sharply dressed lawyer with a penetrating gaze who said he would prove President Donald Trump had sex with a porn star and paid her off to keep quiet ahead of the 2016 election.

Suddenly, Avenatti was everywhere — on Twitter, talking to any camera put in front of him, appearing at rallies and becoming a guest on late-night talk shows, baiting Trump with insults as the president denied having an affair with porn actress Stormy Daniels.

He appeared on cable news shows dozens of times, especially CNN and MSNBC.

“It’s a 24-hour news environment. They need to fill those spaces up, and he was more than happy to fill those spots,” said Robert Thompson, director of Syracuse University’s Center for the Study of Popular Television.

Trump haters loved his willingness to match the president insult for insult. Avenatti relished the fight and the attention it brought.

“I have become an agent for hope for those that are opposing this president,” he said last summer.

His brash, trash-talking style appealed in particular to those who wanted “to see someone engage with the Republican base on that kind of street-fighter level,” said Mark Lukasiewicz, dean of Hofstra University’s Lawrence Herbert School of Communication.

Plus, he was good at it.

“He is articulate. He is telegenic,” said Lukasiewicz, a former executive with NBC and ABC. “He knows how to be provocative in a cable-news landscape where how you speak can become as important as what you know.”

Avenatti’s star had dimmed in recent months amid court fights with former clients and colleagues and an arrest on a domestic assault claim by his girlfriend. Prosecutors declined to file charges.

But it was still a shocking turn when authorities this week announced charges in New York and Los Angeles and arrested Avenatti. Prosecutors say he tried to extort up to $25 million from Nike, fraudulently obtained $4 million in bank loans and pocketed a $1.6 million settlement that should have been provided to a client.

As he was freed on $300,000 bail and denied the allegations, his enemies wasted no time in mocking him. Donald Trump Jr. tweeted that if Avenatti cut a plea deal quickly enough, he might share a prison cell with the president’s longtime personal attorney, Michael Cohen.

Cohen has pleaded guilty to campaign-finance violations for paying hush money to two women, including Daniels, who said they had sex with Trump. The president has denied their claims.

With attention around Daniels’ case intensifying last year, Avenatti seemingly went in front of every camera he could find. He argued with Tucker Carlson on Fox News, called Cohen’s attorney a thug on CNN and told “The Late Show’s” Stephen Colbert that Cohen was a moron.

Over one week last July, Avenatti traveled to Denver on a Monday to accept a legal foundation award, returned to Los Angeles on Tuesday to try to unseal a lawsuit brought by a Playboy centerfold against a Trump fundraiser, then arrived in New York on Wednesday to meet with immigrant children separated from their parents at the U.S. border. Two days later, he was in London taking part in an anti-Trump rally.

The week before, he announced that he was considering running for president in 2020, and he spoke at a Democratic fundraiser in Iowa the following month.

Before Avenatti represented Daniels, he was virtually unknown outside the California legal community. But he was a successful litigator, primarily focused on class-action and whistleblower cases. On his website, he boasts of winning more than $1 billion in settlements and verdicts for his clients.

His alma mater, George Washington University Law School, annually recognizes a graduating student with the Michael J. Avenatti Award for Excellence in Pre-Trial and Trial Advocacy.

Like Trump, Avenatti seemed to devour everything written or said about him and if he didn’t like it, complain immediately and demand retractions.

At a Los Angeles court hearing last year, an Associated Press reporter sitting behind him watched as Avenatti read a story the reporter had written. The lawyer then texted another AP reporter in Washington to complain.

Outside the courtroom, Avenatti got in the face of Brent Blakely, Cohen’s attorney.

“You represent a felon,” Avenatti said disgustedly. To which Blakely replied: “You are a felon.” Avenatti retorted: “I’ve never been convicted of anything.”

If convicted of the charges filed Monday, the 48-year-old could face life in prison. Daniels has dropped him as her lawyer and said after his arrest that she was “saddened but not shocked.”

After posting bond in New York City, Avenatti was his usual brash self.

“I am highly confident that when all the evidence is laid bare in connection with these cases, when it is all known, when due process occurs, that I will be fully exonerated and justice will be done,” he told reporters.

Later, in an interview with CBS News, he offered a rare showing of self-doubt.

“I’m nervous, I’m scared — I’m all of those things,” he said.

More about: