Federal prosecutors took a major step Wednesday in their investigation of hush-money payments made to two women who said they had had affairs with Donald Trump, announcing that the National Enquirer's parent company was cooperating.

The company, American Media Inc. (AMI), the country's biggest tabloid publisher, played an important role in a scheme to keep the women silent in the months before the 2016 election so that Trump's chances would not be damaged. Payments to those women amounted to campaign finance violations, federal prosecutors said.

Under the agreement with AMI, dated in September but previously kept private, federal prosecutors in Manhattan agreed not to charge the company in return for its cooperation.

The agreement came after David Pecker, AMI's chief executive, provided key testimony to prosecutors as they investigated the president's personal lawyer, Michael Cohen. Cohen received a three-year prison sentence Wednesday in part for his involvement in the payments.

According to prosecutors, AMI admitted that its $150,000 payment in August 2016 to Karen McDougal, a former Playboy model who said she'd had a 10-month affair with Trump, had been made in coordination with the Trump campaign and was intended to suppress allegations about the candidate.

Cohen initially denied having any connection to the AMI payment, although the New York Times reported in February that he had been in contact with McDougal's lawyer as it was being negotiated.

From the onset of AMI's deal with McDougal, Cohen had promised to reimburse the company for the payment.

In late summer 2016, Cohen contacted Pecker about fulfilling that promise, prosecutors said in their filing Wednesday.

Pecker agreed to sell the rights to McDougal's story to Cohen for $125,000. To carry out the deal, Cohen incorporated a shell company called Resolution Consultants LLC.

Pecker also directed a consultant to complete the transaction through "a company unaffiliated" with AMI, prosecutors said, a technique that presumably helped mask the transaction.

In another sign that AMI may have sought to hide the deal, the consultant provided Cohen with an invoice that "falsely stated" the purpose of the transaction, according to prosecutors.

The invoice attributed the $125,000 payment to an "agreed upon flat fee for advisory services," when in fact it was to ensure McDougal's silence at a pivotal moment in the campaign.

It was previously known that Trump was aware of Cohen's discussions about paying AMI. During a recorded conversation late in the campaign, Cohen told Trump that "I need to open up a company for the transfer of all of that info regarding our friend, David," a reference to Pecker. Trump asked, "So what do we got to pay for this?"

Although Pecker signed off on the deal, he later contacted Cohen and called it off.

AMI was also involved in the early stages of Cohen's dealing with a second woman, pornographic film actress Stormy Daniels, who said she had had an affair with Trump. The company did not pay Daniels but notified Cohen that she was trying to sell her story.