President Donald Trump speaks as he and British Prime Minister Theresa May hold a press conference after their meeting at Chequers in Buckinghamshire, Britain July 13, 2018.

President Donald Trump is asserting that his former personal lawyer's taping of their private phone conversations is "totally unheard of & perhaps illegal."

Trump was responding to the revelation that former attorney Michael Cohen, weeks before the 2016 election, secretly recorded their discussion of a potential payment for a former Playboy model's account of having an affair with Trump. He tweeted: "The good news is that your favorite President did nothing wrong!"

The recording was part of a large collection of documents and electronic records seized by federal authorities from the longtime Trump fixer earlier this year.

Cohen had made a practice of recording telephone conversations, unbeknownst to those he was speaking with. Most states, including New York, allow for recordings of phone conversations with only the consent of one party; other states require all parties to agree to a recording or have mixed laws on the matter. It was not immediately clear where Trump and Cohen were located at the time of the call.

Cohen's recording adds to questions about whether Trump tried to quash damaging stories before the election. Trump's campaign had said it knew nothing about any payment to ex-centerfold Karen McDougal. It could also further entangle the president in a criminal investigation that for months has targeted Cohen.

The erstwhile Trump loyalist has hired a new attorney, Clinton White House veteran Lanny Davis, and disassociated himself from the president as both remain under investigation. Cohen has not been charged with a crime.

Current Trump attorney Rudy Giuliani said the payment was never made and the brief recording shows Trump did nothing wrong.

"The transaction that Michael is talking about on the tape never took place, but what's important is: If it did take place, the president said it has to be done correctly and it has to be done by check" to keep a proper record of it, Giuliani said.

Davis said "any attempt at spin cannot change what is on the tape."

"When the recording is heard, it will not hurt Mr. Cohen," Davis said in a statement.

The recording was first reported Friday by The New York Times.

The FBI raided Cohen's office, home and hotel room in April, searching in part for information about payments to McDougal and porn actress Stormy Daniels, who received a $130,000 payment from Cohen before the election to keep quiet about a sexual relationship she says she had with Trump. The FBI investigation is separate from special counsel Robert Mueller's probe of election interference in 2016 and potential obstruction of justice by those in the president's orbit.

Referring to that raid, Trump called it "inconceivable that the government would break into a lawyer's office (early in the morning)." In past comments Trump has also referred to the court-ordered seizure as a "break-in," though Cohen has been more sanguine, saying the FBI agents were courteous and respectful.

A self-described fixer for Trump for more than a decade, Cohen said last year he would "take a bullet" for Trump. But he told ABC News in an interview broadcast this month that he now puts "family and country first" and won't let anyone paint him as "a villain of this story." On Twitter, he scrubbed mentions and photos of Trump from a profile that previously identified him as "Personal attorney to President Donald J. Trump."