The Fox News legal analyst Andrew Napolitano has responded to Donald Trump’s Twitter attacks, asking: “This is the way you treat your friends, how do you treat your enemies? Oh boy.”

Last week, in comments that attracted widespread attention, Napolitano argued that the Mueller report showed Trump obstructed justice, and called the president’s behavior “unlawful, defenseless and condemnable”.

On Saturday, Trump responded with tweets bashing the “hostile” TV personality, who he claimed had asked him for a seat on the supreme court.

“Also asked for pardon for his friend,” Trump wrote, without elaborating, before adding a jab at another Fox News personality who has been critical of his record in office, saying Napolitano was “a good ‘pal’ of low ratings Shepard Smith”.

Trump also saluted the “brilliant and highly respected” Harvard lawyer Alan Dershowitz, who told Fox News Napolitano was wrong.

Speaking on Fox Business Network’s Mornings with Maria on Monday, Napolitano said he and Trump had been “ friends for 30 years and probably will be for the next 30 years”. The president’s comments about him, he said, “were brilliant”.

“He wanted to divert attention from what Mueller had said about him,” he said, “and what I had commented about Mueller to his relationship with me, his relationship with me is not the story.”

The former New Jersey superior court judge also denied asking for a supreme court seat, saying Trump had actually asked him, unprompted, to recite his qualifications for the job.

“He said, all right, give me a spiel as to why I should put you on,” he said. “Who would turn that down? I gave him the spiel.”

Trump has made two nominations to the supreme court, of Neil Gorsuch and Brett Kavanaugh. Both men were approved by the Senate, tilting the court to the right.

Of the pardon mentioned by Trump, Napolitano said it concerned “a mutual friend of his and mine and he asked me to tell him what the person was convicted of and if I thought the conviction was just.

“I described what the person was convicted of. I described that it was just, the president used a very strong term to condemn the conviction and he said you know this person as well as I do, call this person up and tell him, tell this person he’s going to be on the list of pardons that I will seriously consider. That was the extent of that conversation.”

Trump’s attitude to and use of the presidential pardoning power has stirred intense controversy. In August 2017, for example, Trump pardoned the hard-right former Arizona sheriff Joe Arpaio.

The Mueller report pays close attention to Trump’s discussion of potential pardons for former aides Michael Flynn, Paul Manafort and Michael Cohen, regarding the investigation of Russian election interference.

Trump, who regularly tweets his thoughts on Fox content, did not immediately respond to Napolitano’s words on Monday.