Like Michael Cohen, David J. Pecker was once one of President Trump’s closest allies.

The National Enquirer boss turned his powerful supermarket tabloids into a veritable Bible of dirt aimed at Hillary Rodham Clinton — and allegedly protected Trump over the years from negative stories peddled by women who claimed to have had tawdry sexual encounters with the mogul.

Now, in yet another stunning twist to the investigation into Trump, the Jewish media executive has reportedly flipped on his longtime associate, giving prosecutors detailed information about the president and Cohen’s involvement in schemes to pay hush money to a porn star and a Playboy model on the eve of the 2016 presidential election.

“Holy s—-, I thought Pecker would be the last one to turn,” a Trump friend told Vanity Fair.

In exchange for his cooperation, Pecker has been granted immunity from prosecution, the Wall Street Journal revealed Thursday.

Pecker’s decision to turn on Trump means a second key Jewish confidant has abandoned the president as prosecutors tighten the noose.

This means three things:



1) Pecker has valuable testimony that federal prosecutors needed.



2) Pecker has some level of criminal liability.



3) Prosecutors believed that, on balance, the interests of justice were best served by granting him immunity so he could testify. https://t.co/BKhiOBSG9N— Renato Mariotti (@renato_mariotti) August 23, 2018

In a possible sign of his value to investigators, Pecker, the son of a bricklayer from the Bronx, becomes the first person known to have been given a free pass from criminal charges in exchange for his story by either special counsel Robert Mueller or federal prosecutors in New York’s Southern District, who are separately probing Cohen’s business dealings.

Cohen pleaded guilty and others have been forced to plead guilty in exchange for agreeing to cooperate in the probes of Trump.

It’s not known if Pecker has cooperated with prosecutors on any aspects of the probe into Trump beyond the hush money deals. Mueller is investigating whether Trump colluded with Russia in a scheme to help him win the presidential election.

Pecker’s decision to cooperate with prosecutors may have added to the pressure for Cohen to abruptly plead guilty this week, the Journal reported Wednesday. Court papers released in connection with Cohen’s guilty plea included details about AMI’s involvement in the hush money scheme, which suggested that someone inside the company had been talking to prosecutors.

Pecker was a longtime friend of Trump, and frequently used his publication to attack his opponents, such as by claiming that the father of then-rival Sen. Ted Cruz was involved in the assassination of John F. Kennedy, and that Clinton was perennially on death’s door.

The Washington Post had even reported that the Enquirer sent stories to Cohen for review before publication, which AMI denied at the time. But according to a report in Vanity Fair, Pecker and Trump haven’t spoken in eight months as awareness has grown of Pecker and AMI’s role in what Cohen described in his guilty plea as a scheme to purchase the women’s stories “so as to suppress them and prevent them from influencing the election.”

AMI allegedly paid Playboy model $150,000 to former Playboy model Karen McDougal, who says she had an affair with Trump more than a decade ago.

Prosecutors say Cohen participated in the deal, which was designed to keep the story out of the public eye because it could hurt Trump in the election. Cohen agreed to pay AMI back through a shell company created for that purpose.

The second hush money payoff was for $130,000 to porn star Stormy Daniels, who claims she had a sexual encounter with Trump several years earlier. In this case, Cohen paid Daniels directly, without involving AMI. But again, the goal of the scheme was to “catch and kill” her story — in other words, to keep it from damaging Trump.

In a statement that now appears to be a baldfaced lie, AMI emphatically denied any influence peddling.

Neither Trump nor Cohen “has attempted to, or ever, influenced (or will ever influence) coverage at A.M.I.’s publications. Period,” it said.

Cohen later demanded — and received — reimbursement for both payments from the Trump Organization, plus a bonus.

Neither Pecker nor any other AMI executives have been charged with crimes, and it’s an open question as to whether their First Amendment right to publish (or not publish) what they see fit would have protected them from charges similar to Cohen’s regarding exceeding campaign payment limits.

The New York Times reported last month that federal investigators had decided that AMI “at times acted more as a political supporter than as a news organization.”

“If Mr. Pecker and his company acted as is alleged, there should and very likely would be no viable First Amendment defense for them,” veteran First Amendment lawyer Floyd Abrams told CNN on Wednesday. “To be sure, publications make editorial decisions as to what to publish or not, but if it is true that as a matter of personal or corporate policy stories were purchased for the purpose of killing them to benefit a candidate for office, the First Amendment would not come into play.”

Pecker has prided himself on his scrappy Jewish upbringing in the Bronx and then the New York suburb of New Rochelle (one story he frequently tells reporters is that his father, one of the only non-Italians working in the business, learned fluent Italian to communicate with coworkers). As he has risen to be one of the most powerful people in media, Pecker has stayed connected to Jewish causes: One of the biggest beneficiaries of his philanthropic foundation over the years has been the American Jewish Committee, which gave him an award in 1997 when he ran a more high-end publishing company, Hachette Filipacchi. The award was presented by John F. Kennedy, Jr., who published George magazine with Hachette Filipacchi. His most recent contribution to AJC was in 2013.

Pecker and the National Enquirer were considered for a Pulitzer Prize for their coverage of former presidential candidate John Edwards’s affair and love child — which, like Cohen, he was charged in federal court with trying to cover up using campaign funds. In Edwards’s case, though, he was found not guilty on one count and received a mistrial on the others.

Contact Aiden Pink at pink@forward.com or on Twitter, @aidenpink