President Donald Trump’s former attorney, Michael Cohen, reportedly recorded the then-Republican candidate while they spoke about a payment to a former Playboy model who claimed to have had an affair with Trump.

Cohen, who’s the subject of a federal investigation into his businesses and payments to women—including Playboy model Karen McDougal and adult film actress Stormy Daniels—made the recording two months before the 2016 election, The New York Times reported Friday, citing attorneys and a confirmation by Trump’s current personal lawyer Rudy Giuliani.

Just days prior to the election, the president’s campaign fully denied any knowledge of the $150,000 payment to McDougal by The National Enquirer for her story after The Wall Street Journal unearthed the payment. The owner of The Enquirer, David Pecker, is a friend of Trump's and the magazine has been accused of buying up stories and not publishing them in a practice dubbed "catch and kill."

The recording is about two minutes long and was discovered after the FBI raided Cohen’s hotel room, residence and office in April and a subsequent review of documents.

“Nothing in that conversation suggests that he had any knowledge of it in advance,” Giuliani told The Times.

Giuliani said that Trump told Cohen that if any funds were paid he should write a check rather than pay with cash so as to properly track the money. He said ultimately the payment was never made.

President Donald Trump speaks at an event where he signed an executive order establishing a National Council for the American Worker and requested leaders of the private sector to sign a "pledge to America's worker's" on July 19 at the White House in Washington, D.C. Getty Images/Win McNamee

McDougal claimed earlier this year to have had an affair with Trump between 2006 and 2007.

The president has denied any affair took place with McDougal or Daniels, whose legal name is Stephanie Clifford. Cohen paid Clifford $130,000 less than two weeks before the 2016 election, but later denied any payment was made.

Trump also denied knowledge of the payment, which critics have alleged served as an in-kind contribution to the president’s campaign and thus violated campaign finance laws.

Prior to the raids and Trump's move to the White House, Cohen served as the billionaire real estate magnate’s self-described “fixer” and often pledged his loyalty to Trump in extreme terms.

But with the federal investigation bearing down and the possibility of years in prison, Cohen has taken to speaking out in veiled ways against Trump. Earlier this month, Cohen told ABC News that he would not be anyone’s “punching bag” for their “defense strategy.”