The jury in the trial of a father-of-four accused of murdering his best friend in his apartment in Dublin two years ago has retired to consider its verdict.

Peter Donnelly, 52, of The Green, Larch Hill Apartments, Santry, has pleaded not guilty at the Central Criminal Court to the murder of Edward Flanagan at the same address on 16 June, 2011.

The 49-year-old died after he was shot in the back of the head while sitting on a couch with a can of beer in his hand.

Mr Donnelly pleaded guilty to two other charges; possession of an automatic pistol and ammunition after he was re-arraigned two days ago.

Mr Justice Paul Carney told the jury of seven men and three women that a not guilty verdict does not arise.

However, he said that they can bring in a verdict of manslaughter if they are not satisfied of the statutory intent for murder.

The judge also told the jury he had been asked to remind them that there was no real explanation for the killing and that Mr Donnelly had told gardaí that it had been an accident.

In summing up the case, the prosecution told the jury Mr Donnelly accepted he had pulled the trigger, did not call for assistance and hindered the emergency services by locking the apartment.

Senior Counsel Eileen O'Leary said they could be satisfied that the gun was placed at Mr Flanagan's neck as the Deputy State Pathologist Dr Khalid Jabbar described it as an "almost hard contact".

She said the accused took steps to change his clothes, lied to gardaí about his actions on the night of the incident, and initially blamed the deceased for bringing the gun into the apartment but later told gardaí he had it himself.

However, defence counsel said while there was no doubt this was a case of homicide, he asked was it murder or manslaughter.

Senior Counsel Patrick Marrinan said the gardaí were completely baffled as to why the killing took place and that no motive was established.

It was clear he said that a large amount of alcohol was involved and the men had been watching violent films.

He also asked the jury to recall the evidence of one of two other men present that night, Gary McMahon.

Mr McMahon told gardaí: "I don't think he meant to do it, I think it was an accident".

He asked the jury to find the accused not guilty of murder but guilty of manslaughter.

The jury has begun its deliberations.