A 50-year-old man has admitted killing another man in the psychiatric unit of Cavan General Hospital just over three years ago.
Ian Harman of Carrickallen, Mountain Lodge, Cootehill, in Co Cavan has admitted causing the death of 81-year-old Michael Treanor in June 2011, but pleaded not guilty to murder.
The court heard the state of mind of the accused man at the time would be an issue for the jury to focus on.
Prosecuting Counsel Patrick McCarthy told the jury that Mr Treanor from Emyvale in Co Monaghan, had been admitted to the psychiatric unit in March 2011, as he had dementia and was refusing to eat.
He said Mr Harman was admitted in June 2011 after an attempt to take his own life.
Mr Harman had been attending a psychiatrist since April that year, the court heard.
He said Mr Harman was in a ward across the corridor from Mr Treanor's room.
On the night of 26 June 2011, the court heard, Mr Harman had trouble sleeping and a doctor had prescribed a sleeping pill.
He was checked at regular intervals and was seen sleeping and heading to the smoking area on various occasions during the night and early morning.
At 6.30am on 27 June 2011, Mr Harman approached a nurse and told her that he was "after doing a bad thing".
He told her he had murdered Mr Treanor by smothering him with a pillow.
Mr McCarthy told the jury the issues of insanity and of diminished responsibility may have to be considered by them.
He said the prosecution would be inviting the jury to bring in a verdict of murder.
Mr Harman's Defence Counsel, Caroline Biggs, told the court that Mr Harman admitted that he had caused the death of Mr Treanor and had no issue with identification of the body or with his arrest, detention or subsequent charge.
She told Mr Justice Garrett Sheehan that her client's admissions would allow the jury to focus on his state of mind.