The High Court has said Louis Walsh is entitled to discovery of documents relating to an investigation by The Sun newspaper.

The paper reported on a garda inquiry into an alleged sexual attack by Mr Walsh on a man in a nightclub toilet.

Mr Justice Iarfhlaith O'Neill ruled that Mr Walsh was entitled to all documents associated with crime writer Joanne McElgunn's investigation into assertions and allegations concerning Mr Walsh and Leonard Watters.

The judge also directed that the newspaper provide all documents identifying or referring to any payments made or offered by the newspaper to Watters and statements of any of Mr McElgunn's expenses attached to the story.

He said Mr Walsh was entitled to any documentation referring to the booking of a hotel room for Watters in June 2011 and directed discovery of bank statements, text messages, emails and records of phone calls relating to the story.

The judge's orders also apply to The Sun's Irish Editor Michael McNiffe; editor of the newspaper in London Dominic Mohan; and journalist Gordon Smart.

The order relates to any information or documents they possess relating to the preparation of the article that was headed: "Louis Probed Over 'Sex Attack' on Man in Loo".

Mr Walsh has sued Newsgroup Newspapers Limited, which publishes The Sun, for damages, including aggravated and exemplary damages, for defamation of character arising out of the article that was published in The Sun on 23 June 2011 and on their website, www.thesun.co.uk, on the same date.

Judge O'Neill said the articles were to the effect that Mr Walsh was being investigated by the police in respect of a claim by the 24-year-old that Mr Walsh had indecently or sexually assaulted him in the toilet of a Dublin nightclub.

He said that in the article in the newspaper there was included a denial by Mr Walsh of the claims and an assertion that he would fully co-operate with any police investigation.

The judge said that not long after the publications it emerged that the allegations were false and Watters was prosecuted in respect of having made them.

He said the newspaper publishers now unreservedly accepted that the allegations against Mr Walsh were false and that he had been completely exonerated in this respect.