An unnamed client of Michael Cohen, President Donald Trump's longtime personal attorney, has been revealed as Fox News host Sean Hannity.

The revelation came after U.S. District Court judge Kimba Wood ordered Cohen's lawyer to disclose the name in a court hearing on Monday.

A lawyer for Cohen at the Monday hearing said that Cohen performed secret legal work for Hannity.

"We have been friends a long time. I have sought legal advice from Michael," Hannity said in response to being revealed as Cohen's third client, according to a Wall Street Journal reporter.

WSJ tweet

Hannity addressed the matter on his radio show Monday afternoon, and said in a statement on Twitter that Cohen has never represented him "in any matter."

He also said that he had "brief discussions" with Cohen about legal matters, but said he "assumed those conversations were confidential."

Hannity tweet 1

Hannity tweet 2

Less than an hour later, Hannity said in a separate statement that his legal discussions with Cohen were "almost exclusively about real estate."

"In response to some wild speculation, let me make clear that I did not ask Michael Cohen to bring this proceeding on my behalf, I have no personal interest in this proceeding, and, in fact, asked that my de minimis discussions with Michael Cohen, which dealt almost exclusively about real estate, not be made a part of this proceeding."

It is yet unclear what specific services Cohen provided for Hannity.

In an earlier court filing Monday morning, lawyers for Cohen refused to identify the recent client — one of three people Cohen represented between 2017 and 2018. The lawyers also refused to identify the names of other past clients.

Lawyers for Cohen — whose business records were seized by FBI agents April 9 — said the then-unnamed client had told Cohen not to disclose his name and that they believed Cohen had a duty not to disclose it.

They also said that if Cohen's clients, other than Trump, were publicly revealed, it is "likely to be embarrassing or detrimental to the client."

The lawyers added, "As to the one unnamed legal client, we do not believe that Mr. Cohen should be asked to reveal the name or can permissibly do so."

Fox News did not immediately respond to CNBC's request for comment.