Former Playboy model Karen McDougal and tabloid news organization American Media Inc. agreed to a settlement on Wednesday, effectively ending a lawsuit she filed with the company over claims she was silenced about her alleged affair with President Donald Trump

Karen McDougal Reaches Settlement With AMI Over Trump Affair

This agreement also helps Trump in that it prevents him from being dragged into a major legal case surrounding attempts to force several women who allegedly had affairs with the president to stay quiet by paying them.

Trump allegedly had an affair with McDougal in 2007 that lasted around 10 months.

American Media Inc. (AMI), which owns the tabloid The National Enquirer, bought the exclusive rights to the former Playmate’s story about Trump in August 2016. The company never published the piece, however, although it paid $150,000 for the story and pledged to use its magazines and news outlets to promote McDougal, who now works as a fitness specialist.

SLIDESHOW: DONALD TRUMP’S 30 CRAZIEST TWEETS

This all comes at the same time Trump and his personal attorney Michael Cohen are facing a defamation lawsuit from porn star Stormy Danielswho is being represented by Michael Avenatti. Daniels has taken Cohen to court in New York to discuss, among other matters, the $130,000 payment she received from Trump’s lawyer in 2016 to silence her about an affair she had with Trump in 2006. Avenatti and Trump engaged in a Twitter feud this week after a sketch of a man who allegedly threatened Daniels in 2011 was released.

Cohen’s office, home and hotel room were raided by the FBI last week in search of documents pertaining to this transaction and to other extramarital affairs Trump allegedly had with women, including information related to Trump’s infamous 2005 Access Hollywood bus tape with Billy Bush. Emails and other forms of communication between Trump and Cohen were also seized in the raids.

The terms of the settlement McDougal reached with AMI dictate that the company maintains the right to up to $75,000 of any forthcoming profits from her recounting of her alleged affair with Trump.

McDougal’s attorney Peter Stris seemed ecstatic about these terms.

“It’s a total win,” Mr. Stris told the New York Times in an interview. “We got everything we were fighting for — she got out of the contract, gets the life rights back and owes A.M.I. nothing more.”

McDougal said she was satisfied with how the settlement turned out.

“Today, I’m doing my victory dance,” the Times said she stated in an interview.

Stris added that his client can keep AMI’s $150,000 payment, and that the publisher will still hold the rights to pictures of McDougal that it already has.

The former model’s lawsuit claimed AMI tricked her into signing the contract that forced her to stay quiet about her affair with Trump. The company’s chairman, David Pecker, is a friend of the president’s. The suit also alleged Cohen inappropriately interfered in negotiations between the two parties.

AMI, which called the settlement an “amicable resolution” in a statement, also refuted claims of having tricked McDougal.

In a case separate from the federal probe into Cohen, the Federal Election Commission has filed a complaint with AMI, claiming that the company’s $150,000 payment to McDougal was an illicit campaign expense, according to the Times. The company has denied this accusation citing the First Amendment right to publish or not publish articles as it pleases.