Image copyright Twitter/ Sean Hannity Image caption Sean Hannity (left) and Michael Cohen

A Fox News host is the mystery third client of US President Donald Trump's lawyer, a court has heard.

A judge ruled that Michael Cohen, the president's personal attorney, must reveal the link to Sean Hannity.

Monday's hearing in New York City follows an FBI raid this month on the presidential lawyer's home and office, which Mr Hannity has called an anti-Trump "witch hunt".

A vocal Trump advocate, Mr Hannity denied he was a client of Mr Cohen.

The conservative host, who is known for passionately defending Mr Trump on his Fox News show against what he describes as biased attacks by the media, had never previously divulged any legal ties to the president's attorney.

Fox News said in a statement: "While Fox News was unaware of Sean Hannity's informal relationship with Michael Cohen and was surprised by the announcement in court yesterday, we have reviewed the matter and spoken to Sean and he continues to have our full support."

What is the court case about?

FBI agents who raided Mr Cohen's home and evidence were looking for evidence on various matters, including a $130,000 (£90,000) payment made to adult-film actress Stormy Daniels, who alleges she had an affair with Mr Trump and was paid "hush money".

Monday saw the judge deny Mr Cohen's attempts to prevent prosecutors from reviewing the materials seized in the FBI raids.

Mr Trump's attorney says the computers, phones and documents should be protected under attorney-client privilege.

But Judge Kimba Wood ruled his application for a preliminary injunction was premature.

The judge allowed prosecutors to proceed with the cataloguing of evidence seized in the raids while a system is set up to ensure that records protected by attorney-client privilege are not disclosed to investigators.

But she will also consider appointing a "special master" to play a supervisory role in the process.

More on Sean Hannity:

Advertisers desert embattled Fox host

ABC star's 'gay insult' in Fox News spat

How did Hannity's name come up?

Image copyright Getty Images Image caption Mr Hannity frequently visits the White House

Just before Monday's hearing, Mr Cohen said in a statement that he had only provided advice to three clients in the past year.

One was Mr Trump. Another was a Republican fundraiser who admitted to paying a former Playboy model after she became pregnant during their affair.

The third client, Mr Cohen said, had refused to give him permission to be publicly named.

But Judge Wood made one of the lawyers identify Mr Hannity on Monday.

There were gasps and some laughter in the courtroom after the announcement, and some journalists raced out of the courtroom to report the revelation.

Mr Hannity later issued a statement of denial.

"Michael Cohen has never represented me in any matter," the Fox host said.

"I have occasionally had brief discussions with him about legal questions about which I wanted his input and perspective.

"I assumed those conversations were confidential, but to be absolutely clear they never involved any matter between me and a third party."

In a post on Twitter, he said the advice "dealt almost exclusively" with real estate.

He maintained it was no "big deal".

After last week's raid on Mr Cohen's offices, Mr Hannity took to the airwaves to denounce the probe as a "declared war against the president of the United States".

Image copyright EPA Image caption Adult-film actress Stormy Daniels spoke to the media outside the federal court

Did Stormy Daniels make an appearance, and what is her role in the case?

Also in the Manhattan federal court was Ms Daniels, whose appearance triggered a scrum by photographers outside.

Mr Cohen has admitted making a payment to the adult film actress, who claims the money was to keep her quiet about an affair she says she had with Mr Trump in 2006.

Mr Trump's attorney says he made the payment just before the 2016 election, but maintains Mr Trump did not know about it.

He is facing a criminal inquiry, which the president has strongly criticised.

The payoff to Ms Daniels could amount to a campaign finance violation, say legal analysts.

The White House has denied Mr Trump had an extramarital affair.