Earlier this month, one of former president Donald Trump’s best-known attorneys — veteran litigator Marc E. Kasowitz — withdrew from a case in which Trump had been sued for alleged defamation.

Trump replaced him with a lower-profile lawyer: Alina Habba, from a four-attorney firm with offices near Trump’s Bedminster, N.J., golf club. Habba had never worked for Trump. Her experience included being general counsel for a parking garage company.

This week, Habba made headlines of her own. On Tuesday, she filed a $100 million lawsuit on Trump’s behalf, targeting the New York Times, three Times reporters and Trump’s niece Mary L. Trump.

Trump alleges that Mary L. Trump violated the terms of a 2001 legal settlement by providing the reporters with family financial records — which they used to write Pulitzer Prize-winning stories in 2018 detailing schemes that Trump and his father allegedly used to dodge taxes.

It is unclear why Kasowitz stopped representing Trump in the defamation case, which was brought by former “Apprentice” contestant Summer Zervos, or how Trump chose Habba to represent him in that suit and the one against the Times. Neither Trump nor Habba responded to requests for comment Wednesday.

Habba has filed other lawsuits against media outlets this year, but she does not list media law among her specialties. She does not appear to have donated to Trump’s campaigns, but this summer she represented Siggy Flicker, a Trump-supporting former cast member of the “Real Housewives of New Jersey,” in a fight with Facebook. The dispute was featured on the conservative channel Newsmax.

Last week, in an interview about the Zervos case, Habba told The Washington Post she had never worked for Trump before taking on that case. She declined to say how she had been connected with Trump.

“I just stepped in,” Habba said. “We’re hoping to have some traction and clear the president’s name.”

In the past, Trump turned to a different attorney, Charles Harder, for lawsuits against media outlets. Harder was known for representing wrestler Hulk Hogan in a lawsuit against the website Gawker, which resulted in a $140 million judgment and the bankruptcy of the site. Harder told The Post on Wednesday that he was no longer working for Trump but otherwise declined to comment.

In recent weeks, three of Trump’s high-profile attorneys have withdrawn from cases in which they represented him or his family. None offered a public explanation.

In addition to Kasowitz, Marc Mukasey — who had previously represented Trump’s foundation and business — withdrew from a case in which he was defending Eric Trump against inquiries from the New York attorney general. Mukasey declined to comment.

Joanna Hendon, of the firm Alston and Bird, had defended Trump against a lawsuit that alleged he defrauded customers by endorsing a scheme to market video phones. But Hendon — who had represented Trump since 2018 — withdrew in August, saying in a court filing that the change had been Trump’s decision.

Trump replaced her firm with a much smaller one, Robert & Robert, located in the Long Island town of Uniondale. Robert & Robert lists five attorneys on its website. In that case, neither Trump’s old attorneys nor his new ones responded to requests for comment Wednesday.

That appears to be an unusual amount of turnover in Trump’s legal team. But the former president still has many lawyers — and many legal headaches.

The Manhattan district attorney has indicted two of Trump’s companies and his longtime chief financial officer on charges of felony tax fraud. Trump is facing defamation lawsuits and also is being sued for allegedly defrauding customers and for allegedly playing a role in the Jan. 6 attack on the U.S. Capitol. And Trump has filed suits of his own against office tenants with unpaid rent, and against tech companies for allegedly censoring him.

In the Zervos defamation case, the former “Apprentice” contestant said Trump had sexually assaulted her in a hotel room. Trump denied the claim and accused her of lying. Zervos sued Trump in 2017, alleging defamation and saying he maligned her when she came forward about the decade-old alleged assault.

Trump’s attorney in that case had been Kasowitz, who had worked with Trump for 20 years, from his business dealings in Atlantic City through his first impeachment as president, when an attorney from Kasowitz’s firm represented Trump. A spokesman for Kasowitz did not respond to questions Wednesday about why Kasowitz had withdrawn from the Zervos case.

His replacement is Habba, whose firm has offices in Bedminster, N.J., and in the Manhattan building that houses Centerpark, the parking garage company where Habba once served as general counsel.

Habba has practiced law since 2011, according to public databases, and is managing partner at the firm Habba Madaio & Associates.

In recent months, court records show, Habba has represented a man suing a New Jersey nursing home for allegedly lax care during the coronavirus pandemic, and a student who sued the University of Bridgeport in Connecticut for not refunding tuition when classes went online-only.

Last month, she sued two Portuguese news outlets for allegedly libeling a New Jersey man by tying him to a far-right Portuguese political party.

Habba’s new lawsuit against the Times, its reporters and Mary Trump reads, at times, like a missive from Trump himself.

It has his vitriol against the news media, accusing the reporters and Mary Trump of “maliciously conspiring against” Trump to further “political vendettas.” It indulges his tendency for self-praise — describing Trump’s “public service to our great country.”

And it had his love for huge numbers, in its estimation that the Times’s story and Mary Trump’s book had caused harm to Trump totaling “no less than One Hundred Million Dollars.” The suit does not explain how Trump came up with that number.

Mary L. Trump told the Daily Beast that she thinks the lawsuit is a sign of “desperation” on the part of Trump. The New York Times issued a statement calling the suit “an attempt to silence independent news organizations.”

“We plan to vigorously defend against it,” the Times said.

In a statement about the suit, Trump said there would be “More to come, including on other people, and Fake News media.”

Shayna Jacobs in New York contributed to this report.