Publishing mogul David Pecker has told federal investigators that he worked with President Donald Trump's longtime fixer and personal attorney Michael Cohen to buy and bury the stories of women claiming affairs with the billionaire -- and that Trump knew, sources told ABC News.

One of those women is Playboy Playmate Karen McDougal but Trump has denied the affair.

There was news Thursday, however, that the National Enquirer may have had a lot more dirt on Trump than just the McDougal story.

David Pecker, Chairman and CEO of American Media, which publishes the National Enquirer, addresses attendees at Party in New York, Aug. 21, 2018.(Marion Curtis/AP) David Pecker, Chairman and CEO of American Media, which publishes the National Enquirer, addresses attendees at Party in New York, Aug. 21, 2018.

The tabloid had been collecting information on the president since the 1980s and that some of the material was kept in a locked safe, The Associated Press said last week.

Pecker, a longtime friend of Trump's, is also CEO of AMI, the parent company of the National Enquirer.

Pecker emptied the safe just before the inauguration, according to AP. It's unclear if he kept the documents, destroyed them or whether they're in the hands of federal investigators.

There was no comment from Pecker when ABC News reached him on the phone.

During the campaign, Trump and Cohen wanted to buy the contents of the safe themselves, The New York Times reported Thursday.

Just weeks before the election, Cohen secretly recorded a conversation with Trump and according to The Times, the two men seemed to discuss buying the Enquirer's Trump files from Pecker.

"I need to open up a company for the transfer of all of that info regarding our friend David," Cohen was heard saying in the recording, which ABC News independently obtained.

President Donald Trump prepares to sign three Executive Orders in the Oval Office of the White House in Washington, Jan. 23, 2017.(Ron Sachs/Getty Images, FILE) President Donald Trump prepares to sign three Executive Orders in the Oval Office of the White House in Washington, Jan. 23, 2017.

On the recording, Trump and Cohen sound worried that the information could fall into the wrong hands if Pecker left the Enquirer or worse.

"And it's all the stuff," Cohen says.

"... Thinking about that," Trump says.

"All the stuff because you never know where that company -- you never know where he's going to be," Cohen says.

"[INAUDIBLE] ...could get hit by a truck," Trump says.

"Correct. So I'm all over that," Cohen says.

That deal never went through and Trump has denied the women's accusations, either directly or through spokespersons.

Last week, Pecker was granted immunity by federal prosecutors in exchange for information in connection with the criminal investigation into Cohen and alleged hush-money payments.

Cohen pleaded guilty last week to eight counts that included campaign finance violations spawned from hush money agreements with two women, Stormy Daniels, who claims to have had an affair with Trump, and McDougal.

Michael Cohen, the former lawyer to President Donald Trump, exits the Federal Courthouse, Aug. 21, 2018, in New York City.(Yana Paskova/Getty Images, FILE) Michael Cohen, the former lawyer to President Donald Trump, exits the Federal Courthouse, Aug. 21, 2018, in New York City.

In court papers filed Aug. 21 as part of Cohen's guilty plea, prosecutors allege that a person identified as "Chairman-1," who ABC believes to be Pecker, "offered to help deal with negative stories about [President Trump's] relationships with women by, among other things, assisting the campaign in identifying such stories so they could be purchased and their publication avoided" -– a process known as "catch and kill" that has shielded Trump from potentially damaging revelations.

ABC News' Jim Hill contributed to this story.