The company that publishes the National Enquirer admitted that it paid $150,000 in hush money to silence alleged mistresses of then-presidential candidate Donald Trump prior to the 2016 election, prosecutors said Wednesday.

The publisher, American Media Inc., will avoid prosecution by stipulating that it worked with Trump's campaign to buy the silence of women — who have identified themselves as adult film actress Stormy Daniels and former Playboy model Karen McDougal — ahead of the vote two years ago, prosecutors said.

The agreement between prosecutors and AMI was signed and dated Sept. 21.

Trump's former lawyer and fixer Michael Cohen was sentenced to three years in prison on Wednesday for lying to investigators about the hush-money operation.

"As a part of the agreement, AMI admitted that it made the $150,000 payment in concert with a candidate’s presidential campaign, and in order to ensure that the woman did not publicize damaging allegations about the candidate," according to a statement by the U.S. Attorney's Office in New York.

"AMI further admitted that its principal purpose in making the payment was to suppress the woman’s story so as to prevent it from influencing the election."

The practice, known in the industry as "catch-and-kill," paid women for the exclusive rights to their story, with the intention of never actually publishing them.

A representative for AMI and the company's CEO, David Pecker, a long-time ally of Trump's, declined comment on Wednesday.

AMI officials will avoid any prosecution as long as they continue to cooperate with investigators, prosecutors said.

"Assuming AMI’s continued compliance with the agreement, the Office has agreed not to prosecute AMI for its role in that payment," according to the statement by the U.S. Attorney's office.

"The agreement also acknowledges, among other things, AMI’s acceptance of responsibility, its substantial and important assistance in this investigation, and its agreement to provide cooperation in the future and implement specific improvements to its internal compliance to prevent future violations of the federal campaign finance laws."