Karen McDougal, who says she carried on a 10-month affair with Donald Trump more than a decade ago, is trying to get out of a confidentiality agreement she struck with the parent company of the National Enquirer. (Dimitrios Kambouris/Getty Images for Playboy)

The publisher of the National Enquirer asked a California court Monday to dismiss a lawsuit brought by a former Playboy centerfold who claims she had an affair with Donald Trump, arguing that the deal it struck with Karen McDougal is protected under the First Amendment.

The 199-page response by American Media Inc. comes less than two weeks after McDougal sued in Los Angeles Superior Court to get out of the deal in which she sold the rights to her story for $150,000. McDougal argued that the National Enquirer violated campaign finance law when it bought her story not to publish it but to bury it, sparing Trump from an embarrassing revelation in the run-up to the 2016 election.

McDougal alleges that AMI colluded with the Trump campaign to hide the story of her affair, citing as evidence company chief executive David Pecker’s friendship with Trump.

In its response, AMI said McDougal was attempting to run roughshod over freedom of the press, suing over an ordinary editorial decision. Media organizations “have a First Amendment right not to publish, and cannot be punished for exercising that right,” the company said in its court filing.

AMI also disputed the notion that the contract prevented McDougal from speaking. Monday’s filing includes a transcript of the hour-long interview McDougal gave to CNN’s Anderson Cooper on March 22, in which she discussed a 10-month relationship with Trump beginning in 2006. Trump and his wife, Melania, had married in early 2005, and their son, Barron, was born in March 2006.

In a tweet, McDougal’s attorney, Peter Stris, said: “As we have learned through brave truth-tellers like Ms. McDougal, the tabloid went to great lengths to silence her and others, and they are now attempting to silence her again with the absurd claim that their own free speech was violated.”

The dispute between AMI and McDougal is among three cases involving Trump’s sexual conduct that are playing out in court and the national media. Stormy Daniels, an adult-film star, is suing President Trump to invalidate a confidential $130,000 deal she signed with Trump attorney Michael Cohen before the 2016 election. And Summer Zervos, a former contestant on Trump’s reality-TV show, “The Apprentice,” is has filed a defamation suit against Trump. Zervos, who claims that Trump forcibly kissed and grabbed her in 2007, says Trump defamed her when he called her a liar.

Cohen has alleged in a court filing that Daniels could owe as much as $20 million for violating the nondisclosure agreement. Trump’s attorneys have argued in the Zervos case that his comments were protected speech.

In its response to McDougal’s lawsuit, the tabloid giant AMI argued that the press is exempt from federal election law, citing dozens of court cases and decisions by the Federal Election Commission.

AMI is represented by a team of lawyers including Lee E. Goodman, a former FEC chairman who stepped down from the commission in February.

Even if AMI’s decision to bury the McDougal story was an effort to help Trump, that would have been constitutional, the company said in its filing. The company pointed to the 57 major U.S. newspapers that endorsed Hillary Clinton for president in 2016 as examples of news organizations seeking to influence elections.

McDougal accused AMI of misleading her about the terms of the contract, alleging that she thought the company was guaranteeing her more than 100 fitness columns in its print and online magazines. AMI rejected McDougal’s claim that it was obligated to publish more than the roughly two dozen columns that it has published to date. In fact, it was not obligated to publish any of her work, the company said.

AMI also noted that McDougal not only signed the contract in August but also signed an amendment in November that allowed her to respond to “legitimate press inquiries.” Neither time did she object to the terms of the agreement, AMI said in its response.

In a statement, AMI said that while it disputes McDougal’s legal claims, the company considers her a “valued contributor” and wants to reach an “amicable resolution satisfactory to her and to AMI.”