US president Donald Trump has said his personal lawyer’s taping of their private phone conversations was “totally unheard of and perhaps illegal”.

Mr Trump was responding to the revelation that, weeks before the 2016 election, his former attorney Michael Cohen secretly recorded their discussion of a potential payment for a former Playboy model’s account of having an affair with Mr 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 long-standing associate of Mr Trump earlier this year.

Mr Cohen had made a practice of recording telephone conversations, without the knowledge of those he was speaking to.

New York state law allows for recordings of conversations with only the consent of one party; other jurisdictions require all parties to agree to a recording. It is not immediately clear where Mr Trump and Mr Cohen were located at the time of the call.

Donald Trump
The recording concerns a former Playboy centrefold (AP)

Mr Cohen’s recording adds to questions about whether Mr Trump tried to quash damaging stories before the election.

His campaign had said it knew nothing about any payment to ex-centrefold model Karen McDougal. It could also further entangle the president in a criminal investigation that for months has targeted Mr Cohen.

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

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

Mr Giuliani said: “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 cheque” to keep a proper record of it.

Mr Davis said “any attempt at spin cannot change what is on the tape”.

He added: “When the recording is heard, it will not hurt Mr Cohen.”

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

The FBI raided Mr Cohen’s office, home and hotel room in April, searching in part for information about payments to Ms McDougal and porn actress Stormy Daniels, who received a 130,000 dollar payment from Mr Cohen before the election to keep quiet about a sexual relationship she claims she had with Mr 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, Mr Trump called it “inconceivable that the government would break into a lawyer’s office (early in the morning)”.

In past comments, Mr Trump has also referred to the court-ordered seizure as a “break-in”, though Mr Cohen has been more sanguine, saying the FBI agents were courteous and respectful.

A self-described fixer for Mr Trump for more than a decade, Mr Cohen said last year he would “take a bullet” for Mr Trump.

But he told ABC News in an interview broadcast this month that he now puts “family and country first” and will not let anyone paint him as “a villain of this story”.

On Twitter, he scrubbed mentions and photos of Mr Trump from a profile that previously identified him as “Personal attorney to President Donald J Trump”.