Two months before the 2016 election, longtime Donald Trump attorney Michael Cohen secretly taped a conversation with the then-GOP presidential nominee about whether to purchase the rights to Playboy centerfold Karen McDougal’s account of her alleged extramarital affair with Trump, according to three people familiar with the conversation.

The recording, which Cohen made surreptitiously in Trump Tower in early September 2016, was seized by federal agents who are investigating Cohen for potential bank and election-law crimes, according to multiple people familiar with the probe.

Trump and Cohen’s discussion came a month after AMI, the parent company of the National Enquirer, bought the rights to McDougal’s story for $150,000, then shelved it.

In the 90-second conversation, Cohen can be heard urging Trump to consider buying the rights to McDougal’s claims to better “control” the story, according to people familiar with the exchange.

In a statement Friday, President Trump’s attorney Rudolph W. Giuliani confirmed the recording’s existence and said no payment was ever made. He said the conversation does not pose any legal jeopardy for the president.

“Nothing in that conversation suggests that he had any knowledge of [the AMI payment] in advance,” Giuliani said. “In the big scheme of things, it’s powerful exculpatory evidence.”

However, the recording shows that Trump — whose spokeswoman denied he had any knowledge of the AMI deal with McDougal when it became public days before the election — in fact knew of her claims and efforts to keep her quiet at least two months earlier.

The timing of the conversation between the GOP nominee and his longtime “fixer” also provides more evidence that Cohen was trying to squash embarrassing stories about Trump before the election — a major focus of the investigation by federal prosecutors in Manhattan.

As part of their probe, investigators have sought documents related to Cohen’s interactions with AMI, as well as to an October 2016 hush-money payment he arranged with adult-film actress Stormy Daniels, who also claimed to have had a sexual encounter with Trump.

To pursue criminal charges against Cohen for breaking federal election law, prosecutors would have to have evidence that the payments went to the women to influence the election, rather than just to protect Trump personally.

Cohen, who served for a decade as a lawyer at the Trump Organization, was known to sometimes record conversations with associates, store them digitally and then replay them for colleagues, as The Washington Post reported in April.

In the brief recording made in September 2016, Cohen can be heard telling Trump that AMI had recently purchased the rights to McDougal’s account of a 10-month affair that allegedly took place soon after he married Melania.

Cohen then proposed that Trump buy the rights to “control” the inflammatory story, according to multiple people familiar with the exchange.

Two people familiar with the conversation said Cohen was suggesting Trump buy the rights from AMI.

Trump is largely silent in the conversation, the people said, neither expressing surprise nor indicating whether he knew previously about the AMI deal.

He asks Cohen how they would pursue buying the rights. The two men discuss whether to use a check, rather than cash, which would create a record, according to the people. A Trump adviser said Trump suggested using a check, while a person close to Cohen claimed Cohen was the one who advised that route.

The recording cuts off with Trump mid-sentence, one person said, and picks up in the middle of a conversation Cohen is having with another person.

The New York Times first reported the existence of the recording.

It is unclear why Cohen and Trump discussed how to purchase the story from AMI and then apparently did not complete the transaction.

The revelation of the recording of their conversation comes as Cohen has signaled that he might be willing to cooperate with the investigation into his business dealings.

On Friday, Lanny Davis, an attorney for Cohen, said in a statement: “Obviously, there is an ongoing investigation, and we are sensitive to that. But suffice it to say that when the recording is heard, it will not hurt Mr. Cohen. Any attempt at spin can not change what is on the tape.”

The recording was seized in April when FBI agents raided Cohen’s residences and office, seeking records related to McDougal and Cohen, among other documents.

A person familiar with the investigation said Trump’s attorneys, who are reviewing all the material seized in the raids, have not claimed the recording is a privileged attorney-client conversation.

The Wall Street Journal first reported four days before the November 2016 election that McDougal had been paid by the National Enquirer. At the time, Trump campaign spokeswoman Hope Hicks called McDougal’s claims “totally untrue.”

“We have no knowledge of any of this,” she said.

Earlier this year, in an interview with CNN, McDougal detailed what she said was a 10-month affair she had with Trump in 2006 and 2007.

The former Playboy model said that after their first sexual encounter, Trump tried to offer her money. She said that she turned down the offer and that she began a relationship that included interactions between the two “many dozens of times.”

In August 2016, AMI paid McDougal $150,000 for the right to her story but never published an article based on her account. As part of the deal, McDougal signed a nondisclosure agreement that prevented her from revealing the affair.

She filed a lawsuit against AMI this year seeking to regain the rights to her story and settled with the company in April.

In her lawsuit against AMI, McDougal said she was happy when AMI bought her story then did not publish it, because she was not anxious for publicity. But she said her opinion changed this year when she learned new details about the deal, including that her attorney at the time and AMI had both been in contact with Cohen while her deal was being negotiated.

On Friday, McDougal attorney Carol Heller wrote on Twitter that she was “learning of this in real time just like everyone else.” She declined to comment further.

Peter Stris, a lawyer who negotiated McDougal’s settlement with AMI earlier this year, tweeted, “When @realDonaldTrump said we were lying, do you think he meant we WEREN’T?”

Correction: An earlier version of this story inaccurately described Cohen’s comments in the recording. While Cohen can be heard urging Trump to buy the rights to McDougal’s story from American Media Inc., he did not explicitly say “I think we need to bring this in-house.” This post has been updated.

Josh Dawsey, Tom Hamburger and Beth Reinhard contributed to this report.