WASHINGTON (Reuters) - U.S. President Donald Trump’s onetime personal attorney Michael Cohen recorded a conversation with Trump two months before the 2016 election in which they discussed buying the rights to a story by a former Playboy model who said she had an affair with Trump, one of the president’s lawyers said on Friday.

Lawyer Rudy Giuliani said that no campaign funding was involved in the discussion between Trump and Cohen, who has distanced himself from Trump in recent months as the FBI investigates Cohen’s business dealings. If campaign funds were used, that could run afoul of federal election law, legal experts said.

Before the election, the Trump campaign denied any knowledge of payment to McDougal, but the taped conversation could undermine those denials. The existence of the audio recording was first reported by the New York Times, which said Trump and Cohen discussed a potential payment to the former model, Karen McDougal.

Giuliani confirmed the conversation to Reuters and that it took place in September 2016 but said it involved reimbursing the parent company of the National Enquirer tabloid for McDougal’s story rights. The payment was never made, he said.

Giuliani denied Trump had an affair with McDougal. He said the tape would show that Trump makes clear that if there is going to be a payment, it should be done by check, which would be easily traced.

Lanny Davis, an attorney for Cohen, said in a Twitter post that, when the recording was heard, it would not hurt Cohen. “Any attempt at spin can not change what is on the tape.” Reuters has not heard the audiotape.

A representative for McDougal did not immediately respond to requests for comment from Reuters. The White House also declined comment.

U.S. President Donald Trump's personal lawyer Michael Cohen exits his hotel in New York City, U.S., July 2, 2018. REUTERS/Brendan McDermid

McDougal sold her story for $150,000 in August 2016 but it was never published by the National Enquirer, a practice known as “catch and kill” to prevent a potentially damaging story from becoming public. David Pecker, the chairman of parent company American Media Inc (AMI) is Trump’s friend. McDougal has said she began a nearly year-long affair with Trump in 2006 shortly after his wife, Melania, gave birth.

Giuliani said the discussion of payment did not mean McDougal’s claim of an affair was true and characterized it as an attempt to resolve false allegations that were “personally damaging” to Trump.

“The way it was going to be structured is very important,” Giuliani told Reuters on Friday. “It was basically going to be a reimbursement to AMI not from campaign funds. There was no discussion of the campaign or campaign assets.”

Under U.S. election law, presidential candidates must disclose campaign contributions, which are defined as things of value given to a campaign in order to influence an election.

A payment intended to silence allegations of an affair just before an election could constitute a campaign contribution, said Joshua Douglas, a professor at the University of Kansas.

Giuliani said the proposed payment was a personal matter and not subject to campaign finance law.

The New Yorker magazine reported in February that Trump had an affair with McDougal at the same time he had a relationship with porn star Stormy Daniels and that the National Enquirer prevented McDougal’s story being made public. The White House has said that Trump denies having sex with Daniels.

Federal prosecutors in New York are investigating Cohen for possible bank and tax fraud, and for possible campaign law violations linked to a $130,000 payment to Daniels and other matters related to Trump’s campaign, a person familiar with the investigation has told Reuters. Cohen has not been charged with any crime.

Giuliani said the FBI seized the recording this year during a raid on Cohen’s office.

The FBI investigation stemmed in part from a referral by the U.S. special counsel’s office, which is looking into possible coordination during the election campaign between Trump’s aides and Russian officials. Moscow denies U.S. allegations that it interfered in the election and Trump denies any campaign ties to Russian officials.