NEW YORK — In the small hours on the morning of his 41st birthday, lawyer Michael Avenatti lay restless at his home in Newport Beach, Calif. He was waiting on an email, and it finally arrived, with brain-rattling force, around 5:30 a.m.

A court in New Jersey had reversed a $41 million verdict he’d won against the accounting giant KPMG in a case involving allegations of massive auditing fraud. Avenatti, who thought of himself as the “KPMG Killer,” had missed the earlier-than-expected birth of his first daughter while doing depositions in the case on the opposite coast; he’d burned through $3 million in out-of-pocket expenses, and his firm stood to gain somewhere in the neighborhood of $16 million in legal fees.

Now he would get nothing.

“Ninety percent of lawyers who had taken one on the chin like that, they’d be done,” Avenatti said last week over coffee at a luxury Central Park hotel.

That setback in 2012 now serves as a parable of resilience in the legend Avenatti has been crafting about himself — both with a string of multimillion-dollar jury verdicts and with his brash, almost nonstop cable news appearances. Avenatti is locked in a legal throwdown with the president of the United States over porn star Stormy Daniels, who appeared on “60 Minutes” Sunday for a much-hyped interview about her alleged affair with Donald Trump and the hush money she says she received during the 2016 campaign to keep it a secret.

Avenatti, who has heightened anticipation for his client’s television appearance by dribbling out hints about major revelations, has linked his reputation to the Daniels case. It is another big bet for an attorney with an enormous appetite for risk whose roster of courthouse adversaries includes mega-corporations, as well as celebrities, such as Paris Hilton and Jim Carrey.

“He is an adrenaline junkie,” says Jonathan Turley, who taught Avenatti at George Washington University’s law school and has stayed in touch since his former student earned his law degree. “I think he needs that adrenaline rush. He lives his life aggressively. In both litigation and in life he shows a certain aggressive style.”

One moment Avenatti is pinballing among courtrooms across the country for high-stakes litigation, including last year’s $454 million judgment in a surgical-gown fraud case, one of the largest in California history. The next he’s delving into entrepreneurial pursuits, such as buying Tully’s, a struggling Seattle coffee-shop chain, or blasting around a track while competing as a driver in a professional racecar circuit, sometimes hitting speeds of up to 195 mph. The main photographon his website depicts him in a race suit rather than a business suit.

Avenatti, now 47, won’t say how he ended up representing Daniels beginning about six weeks ago. The porn actress and director, whose real name is Stephanie Clifford, has claimed that she had an affair with Trump in 2006 while he was a reality-TV star whose wife, Melania, had recently given birth to their son.

“Initially, I was very skeptical about getting involved because I, much like many Americans, had preconceived notions about Stormy Daniels and her motivations and what she is all about,” Avenatti says.

It took him only about 20 minutes to decide that she was credible, he says, although he won’t reveal what led him to that conclusion. One thing he says he hasn’t done is examine her on-screen appearances.

He goes on to say that “we have in this country this Puritan, hypocritical, nonrealistic view of sex that is entirely different than the view, for instance, in Western Europe.”

Avenatti’s foil in the Daniels melodrama has been Trump’s lawyer Michael Cohen, as much as the president. Cohen has said he took out a home-equity loan to pay Daniels $130,000 of his own money to keep her story of the affair secret and drafted a nondisclosure agreement. Avenatti has called Cohen’s claim that the president knew nothing of the deal “ridiculous.”

Avenatti has been daring Cohen to appear on television with him to discuss the case. He recently used an enlarged photograph of Cohen as a prop during a contentious appearance on CNN with Cohen’s attorney, David Schwartz. (Cohen andSchwartz did not respond to requests to comment for this article.)

“That was fun,” Avenatti says.

The legal dispute with Daniels and Trump centers on the particulars of the porn star’s nondisclosure agreement. But Avenatti is arguing a broader case about the integrity of the president and his legal team — and drawing from a well-honed playbook of using media appearances as an integral part of his strategy.

“Have I ever not been confident or have I ever not acted confident?” says Avenatti, whittling and reframing a question. “I think I’ve always acted confident even at times I haven’t been confident.”

Brian Panish, a prominent plaintiffs attorney who has worked on cases with Avenatti, compares his former colleague to William Ginsburg, Monica Lewinsky’s attorney famous for appearing on all the Sunday talk shows on the same day during President Clinton’s White House-intern sex scandal. It spawned the term “the full Ginsburg.”

“Avenatti knows how to deal with the media,” Panish says. “He seems to like it. You’re going to have to rename it — there’s no more full Ginsburg, it’s the full Avenatti.”

In the television studio, Avenatti looks right at home. He’s olive-complected, square-jawed and, on the days he doesn’t shave, he seems to have perfected the art of the fashionable five o’clock shadow. His tastes are expensive, running to tailored suits and hot rods. He won’t reveal what he drives at home in West Los Angeles, where he now lives, coyly saying he has “a few cars that I can pick from.” On his wrist is a sleek, silver Patek Philippe watch.

Avenatti was born in Sacramento and lived as a young child in Utah and Colorado before the family settled in St. Louis in the midst of a hot 1982 baseball pennant race that turned him into a rabid Cardinals fan. His father worked as a liaison between wholesalers and Anheuser-Busch.

After Avenatti left to attend the University of Pennsylvania, his father was unexpectedly laid off, and the son went to work to earn tuition money by doing opposition political research on Republicans and Democrats for a firm owned by Rahm Emanuel, the future chief of staff in the Obama White House and the current mayor of Chicago. Avenatti says he saw the “soft underbelly of politics,” and he left the job with a “significant degree of cynicism.”

In law school, he clerked at a law firm by day and took courses at night, finishing first in his class. He accumulated $340,000 of student debt, which he says he later erased with the bonus for a single big verdict while he was working at a California firm. His cases included a $10 million defamation lawsuit, which ended in a confidential settlement, that he filed on behalf of a socialite client against Paris Hilton. He was also on a team of lawyers who sued Trump and the producer of “The Apprentice” on behalf of a man who said they stole his idea for the hit show. The case ended in a settlement.

Michael Avenatti, the attorney for Stormy Daniels, who allegedly had an affair with Donald Trump. (Jennifer S. Altman/For The Washington Post)

But Avenatti had larger ambitions than working in an established firm. In 2007, he went out on his own, taking on cases that he managed as aggressively on television as in the courtroom. A lawsuit against a cemetery that allegedly disturbed existing graves to accommodate new coffins ended in an $80 million settlement in 2015. Another high-profile case — a wrongful-death lawsuit in the suicide of actor Jim Carrey’s ex-girlfriend — was resolved out of court.

Avenatti says he’s been lead counsel on $1 billion worth of verdicts and settlements. The biggest, by far, came last year when he won a $454 million jury verdict in a case against Kimberly-Clark and Halyard Health related to claims that the companies knowingly sold defective surgical gowns that were not impermeable to Ebola and HIV, despite representations that they were. It’s a decision that could generate more than $100 million in fees for Avenatti’s legal team if it holds up to planned appeals.

Avenatti, at times, has been a magnet for controversy, falling out with the “Grey’s Anatomy” star Patrick Dempsey, a friend who briefly partnered with him in the Tully’s coffee chain. The chain is mired in legal disputes and has been shuttering locations. But Avenatti says he made a profit — how much, he didn’t reveal — by selling his piece of the firm, and is now “essentially the general counsel.”

“Timing is everything. I exited at the right time,” he says. “Basically, they’re just another client now.”

At the same time that he has been a ubiquitous presence on cable news sets in the Daniels case, Avenatti has also been engaged in a heated financial dispute with a former law partner who’d sued, saying he was owed millions in unpaid fees. At a court hearing, a lawyer for one side characterized the level of acrimony as “unbelievable.” But the partners have now settled the case and are back on speaking terms, and Avenatti — employing a few four-letter words, as he is wont to do — says the portrayal of the squabble has been “overblown.”

It comes with the territory, Avenatti says in the interview at the New York hotel. He cites an old saying about how a monkey’s backside becomes more visible the higher it goes in a tree.

“I’m starting to get pretty high up in the tree,” he says.

As he talks, his phone lies on the table, its battery fading from overuse. He’s getting 100 to 125 interview requests a day, he says.

He checks his phone. Time is running short. He’s got to go. He has a radio interview in a few minutes.

Emma Brown and Alice Crites contributed to this report.

Manuel Roig-FranziaManuel Roig-Franzia is a feature writer in The Washington Post’s Style section, where he profiles national figures in the worlds of politics, the law and the arts. He previously served as bureau chief in Miami for The Post's National staff and in Mexico City for the Post's Foreign staff. He is the author of a biography of Sen. Marco Rubio. Follow