The Supreme Court has ordered a retrial of Brian Rattigan for the murder of a man in Dublin 17 years ago.

Mr Rattigan was sentenced to life in prison in 2009 after a jury convicted him of the murder of 21-year-old Declan Gavin outside a fast food restaurant in Crumlin Shopping Centre in August 2001.

In December, the court quashed that conviction after finding that comments made by the trial judge at the end of the trial "went further than were desirable."

The majority of the court found that the comments made by the trial judge may have been seen as reflecting his personal opinions and may have influenced the jury in its view of the defence case.

This morning, the court heard arguments from the prosecution and defence on an application by the Director of Public Prosecutions asking the court to order a retrial.

Senior Counsel Pauline Walley told the court a review of the case had been carried out by the DPP and she was satisfied there was a sufficient case to be brought before the Central Criminal Court for trial.

Mr Rattigan's counsel Brendan Grehan had argued against a retrial on a number of grounds, including delay and adverse pre-trial publicity.

In its ruling, Chief Justice Mr Justice Frank Clarke said the court must consider whether or not it was in the interests of justice that a retrial takes place.

He said the court would only decline to order a retrial where it was a clear case that delay or pre-trial publicity meant there could not be a fair trial.

In this case, the court was not persuaded that this was such a case and directed that a retrial should take place.

During this morning's arguments to the Supreme Court lawyers for Mr Rattigan had argued that he could not receive a fair trial due to previous adverse publicity.

Mr Brendan Grehan said while it might be argued that a trial judge can give direction to a jury not to access material related to a case, this would be "inconceivable, given the prevalence of social media" he said. 

Ms Justice Elizabeth Dunne said the reality of the situation was that a trial judge had to have regard to the possibility that someone would do something they should not do online.

She said there had been cases in the UK where jury members have been prosecuted for carrying out their own research. Ms Justice Dunne said trials "can be policed."

Mr Grehan said however that in this jurisdiction there was no specific offence with which to charge a juror who did so and it would fall into the area of contempt.

Ms Justice Dunne said that "the existing and well established laws on contempt" did not mean such things could not be dealt with.

"It may well be that there is no statutory provision that says a juror who does X will be sentenced, but it can still be dealt with under the contempt jurisdiction."

Mr Grehan said he was not aware of any case where this had even been attempted. He said in relation to social media "we are all playing catch up."

Ms Justice Dunne said: "The point is, can it be policed and the answer is yes. You can’t say we can't have a trial because the legislature has not brought in a specific law."

Mr Justice McKechnie said: "We simply cannot close shop."