A man attempted to cut a prison officer's wrist with a blade moulded into a toothbrush while the officer was delivering toilet paper, a court has heard.

Alan Ellis, 26, of Rathmines Road Lower, Rathmines, Dublin, pleaded guilty at Dublin Circuit Criminal Court to threatening to kill a prison officer and producing a blade in the course of a dispute at Mountjoy Prison on 28 June 2016.

Detective Garda Barry Brennan told prosecutor Antonia Boyle that on the day in question the prison officer was delivering toilet paper to Ellis at the prisoner's request.

The officer handed the toilet paper through the hatch of Ellis's cell and he took it with his left hand. The court heard that he swung a blade moulded into the handle of a tooth brush, which was in his right hand, at the prison officer, which connected with the officer’s fleece.

When the officer asked him why he had attacked him, the court heard that Ellis said: "F*** you, I'll chop you up."

Ellis made a statement about the incident in which he said he had decided to "get" the prison officer because he thought he was being disrespectful to him, and the prisoner’s intention had been to slice his wrist.

He said he made the statement because he felt guilty afterwards and knew he had done wrong.

In a victim impact statement read out in court, the officer said that "this assault really unnerved me and left me shaken", and that he does not understand to this day what led Ellis to attempt to hurt him.

Defence counsel Cathal Ó Braonáin said his client had been in solitary confinement for the majority of the last four years.

Ellis was serving a sentence at the time of the attack, but that sentence had expired and he has been in custody solely on this matter since 21 July 2017.

Mr Ó Braonáin said Ellis had been diagnosed with Tourette syndrome when he was seven years old and got into fights in school due to being teased over this condition. He was expelled from three different schools.

Ellis was diagnosed with paranoid schizophrenia in 2015. Mr Ó Braonáin handed in a psychiatric report to the court, detailing that the root of his offending was perceived targeting and taunting.

The report gives the view that his current regime of imprisonment is not conducive to therapeutic benefit, the court heard.

Ellis's mother and sister, who were present in court, have written to the Taoiseach and several cabinet ministers to get a change in his regime.

Judge Patricia Ryan adjourned the matter to 20 December for finalisation.