NEW YORK—The National Enquirer kept a safe containing documents on hush money payments and other damaging stories it killed as part of its cozy relationship with Donald Trump leading up to 2016 presidential election, people familiar with the arrangement told The Associated Press.

The detail came as several media outlets reported on Thursday that federal prosecutors had granted immunity to National Enquirer chief David Pecker, potentially laying bare his efforts to protect his longtime friend Trump.

Trump’s former lawyer Michael Cohen pleaded guilty this week to campaign finance violations alleging he, Trump and the tabloid were involved in buying the silence of a porn actress and a Playboy model who alleged affairs with Trump.

Several people familiar with the National Enquirer’s parent company, American Media Inc., who spoke to the AP on the condition of anonymity because they signed non-disclosure agreements, said the safe was a great source of power for Pecker, the company’s CEO.

The Trump records were stored alongside similar documents pertaining to other celebrities’ catch-and-kill deals, in which exclusive rights to people’s stories were bought with no intention of publishing to keep them out of the news. By keeping celebrities’ embarrassing secrets, the company was able to ingratiate itself with them and ask for favors in return.

But after The Wall Street Journal initially published the first details of Playboy model Karen McDougal’s catch-and-kill deal shortly before the 2016 election, those assets became a liability. Fearful that the documents might be used against American Media, Pecker and the company’s chief content officer, Dylan Howard, removed them from the safe in the weeks before Trump’s inauguration, according to one person directly familiar with the events.

The AP cannot say whether the documents were destroyed or simply were moved to a location known to fewer people.

American Media did not immediately respond to a request for comment.

Pecker’s immunity deal was first reported Thursday by Vanity Fair and The Wall Street Journal, citing anonymous sources. Vanity Fair reported that Howard also was granted immunity.

Court papers in the Cohen case say Pecker “offered to help deal with negative stories about (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.”

The Journal reported Pecker shared with prosecutors details about payments that Cohen says Trump directed in the weeks and months before the election to buy the silence of McDougal and another woman alleging an affair, porn star Stormy Daniels. Daniels was paid $130,000, and McDougal was paid $150,000.

While Trump denies the affairs, his account of his knowledge of the payments has shifted. In April, Trump denied he knew anything about the Daniels payment. He told Fox News in an interview aired Thursday that he knew about payments “later on.”

In July, Cohen released an audio tape in which he and Trump discussed plans to buy McDougal’s story from the Enquirer. Such a purchase was necessary, they suggested, to prevent Trump from having to permanently rely on a tight relationship with the tabloid.

“You never know where that company — you never know what he’s gonna be —” Cohen says.

“David gets hit by a truck,” Trump says.

“Correct,” Cohen replies. “So, I’m all over that.”

Former Enquirer employees who spoke to the AP said that negative stories about Trump were dead on arrival dating back more than a decade when he starred on NBC’s reality show “The Apprentice.”

In 2010, at Cohen’s urging, the National Enquirer began promoting a potential Trump presidential candidacy, referring readers to a pro-Trump website Cohen helped create. With Cohen’s involvement, the publication began questioning President Barack Obama’s birthplace and American citizenship in print, an effort that Trump promoted for several years, former staffers said.

The Enquirer endorsed Trump for president in 2016, the first time it had ever officially backed a candidate. In the news pages, Trump’s coverage was so favorable that the New Yorker magazine said the Enquirer embraced him “with sycophantic fervor.”

Positive headlines for Trump, a Republican, were matched by negative stories about his opponents, including Hillary Clinton, a Democrat: An Enquirer front page from 2015 said “Hillary: 6 Months to Live” and accompanied the headline with a picture of an unsmiling Clinton with bags under her eyes.