Famed law professor Alan Dershowitz confronted Sean Hannity on his show on Monday, saying the pundit should have disclosed publicly that he had secretly been legally represented by President Donald Trump’s longtime personal lawyer—who’s been a guest on Hannity’s TV and radio programs.

Michael Cohen, who is currently under criminal investigation by the U.S. attorney’s office in the Southern District of New York, had sought to keep Hannity’s identity as a client a secret. A federal judge on Monday rejected Cohen’s attorney’s request, revealing the news to audible gasps in the Manhattan courtroom.

During an unrelated interview on Hannity’s Fox News show on Monday, Dershowitz told Hannity he should’ve disclosed his relationship with Cohen before airing segments about the recent raids on Cohen’s offices.

"I really think that you should have disclosed your relationship with Cohen when you talked about him on this show,” Dershowitz said. “You could’ve said just that you asked him for advice or whatever, but I think it would’ve been much, much better if you had disclosed it.”

Dershowitz, a Harvard law professor who has become one of the most prominent legal defenders of Trump, said Hannity should’ve emphasized that Cohen did not perform many major legal activities on the Fox News host’s behalf.

“It would’ve been fair to say that it was minimal,” Dershowitz said. “You were in a tough position because A: You had to talk about Cohen and B: You didn’t want the fact that you had spoken with him to be revealed.”

“It was such a minor relationship,” Hannity said.

“You should’ve said that,” Dershowitz replied.

In a monologue later on his show Monday evening, Hannity repeated that Michael Cohen “never represented me in any legal manner,” and the Fox News host’s legal questions focused “almost exclusively” on real-estate.

“I never paid Michael Cohen for legal fees,” Hannity said. “I did have occasional, brief conversations with Michael Cohen, he’s a great attorney, about legal questions I had.”

He continued: “My discussions with Michael Cohen never rose to any level that I needed to tell anyone that I was asking him questions. And to be absolutely clear: They never involved any matter, any—sorry to disappoint so many—matter between me, a third party, a third group, at all.”

The anchor seemed to enjoy the larger audience of media speculators, running a montage of other cable personalities discussing him, and opening his show with a “special shout-out,” to “all of you liberals in the media and all across America, everyone out there that may not usually watch who are tuning in.”