As adult film actress Stormy Daniels looked on, a federal judge ordered U.S. President Donald Trump's longtime personal lawyer Michael Cohen to cough up the name of a client he had hoped to keep secret at a Monday court hearing: Sean Hannity.

Hannity is a conservative television host known for passionately advocating for Trump on his Fox News show, and often receiving public praise from Trump in return. Calls to a Fox News spokesperson by Reuters were not immediately returned.

Cohen was in court to ask a judge to limit the ability of federal prosecutors to review documents seized as part of a criminal investigation.

The investigation has frustrated the White House as it has spread to enfold some of Trump's closest confidantes. But in the background, Cohen also had to contend with Daniels's efforts to keep attention on her story, relating to an alleged affair with Trump.

Cohen's lawyers revealed in court on Monday that Fox News host Sean Hannity, right, is among Cohen's clients. (Swth Wenig/Associated Press, Nicholas Kamm/AFP/Getty Images)

Daniels is engaged in a separate civil legal fight over $130,000 US she received in a 2016 agreement arranged by Cohen to stop her from discussing a sexual encounter she says she had with Trump a decade earlier.

Photographers knocked over barricades outside the courthouse as they scrambled to get pictures of Daniels, whose real name is Stephanie Clifford, arriving for court. Inside, she quietly took a seat in the public gallery with her lawyer.

Hannity said on his radio show that he had known Cohen a long time, but that he had "never represented me in any matter, I never retained him in the traditional sense."

The Fox News personality said he never received an invoice from Cohen, or paid him fees, but "I have occasionally had brief discussions with him about legal questions about which I wanted his input and perspective. And I assume that those conversations were attorney-client confidential."

Hannity said none of the dealings he had with Cohen involved a third party.

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, —@seanhannity which dealt almost exclusively about real estate, not be made a part of this proceeding. —@seanhannity

On Monday's show, Hannity expressed amusement at the firestorm of media coverage unleashed by the disclosure that he and Trump shared a legal adviser in Cohen, playing a 45-second, rapid-fire montage of various TV commentators and anchors uttering his name on the air throughout the day.

Previously, it had been revealed that another client of Cohen's was RNC fundraiser Elliott Broidy, who was recently in the news over a payment to a Playboy model Broidy had a relationship with.

Fight over privilege

Cohen has argued that some of the documents and data seized in last week's raids are protected by attorney-client privilege or otherwise unconnected to the investigation.

But Judge Kimba Wood rejected his efforts to mask the identity of Hannity, a client Cohen had said wanted to avoid publicity.

Porn actor says she's committed to making sure everyone finds out the truth. 0:42

"I understand if he doesn't want his name out there, but that's not enough under the law," Wood said, before ordering a lawyer for Cohen to disclose the name.

Cohen has asked the court to give his own lawyers the first look at the seized materials so they can identify documents that are protected by attorney-client privilege.

Failing that, they want the court to appoint an independent official known as a special master, a role typically filled by a lawyer, to go through the documents and electronic data seized under a warrant and decide what prosecutors can see.

Prosecutors have asked that the documents be reviewed for attorney-client privilege by a "filter team" of lawyers within their own office, who would be walled off from the main prosecution team.

A lawyer for Trump, Joanna Hendon, asked in a filing on Sunday to be allowed to review documents that in any way relate to the president, which she described as being seized amid a "highly politicized, even fevered, atmosphere." She also appeared in court on Monday.

Wood adjourned the hearing Monday, rejecting Hendon's request for a temporary restraining order on the grounds that it was too early for such an objection. As a first step, the judge said the government should put the documents in a searchable database to determine which ones should come under review.

The hearing ended on Monday with no ruling on who gets to filter the seized documents. The judge said she hasn't decided whether she'll appoint a special master to review the documents, but said it may have a role in this case.