An off-duty garda prevented a Garda station from being damaged after a patrol car was set alight outside the premises, a court has heard.
Details of the incident were heard as a man appeared before Letterkenny District Court charged with the arson of a garda car outside Castlefin Garda station in Co Donegal.
The incident took place just after 4am on Saturday.
The court was told that Gary McGinley had been captured on CCTV pouring petrol on the Hyundai i30 estate patrol car, causing €10,000 of damage to the vehicle.
Sergeant Jim Collins told the court the car was parked approximately eight feet from the front of the Garda station.
The court also heard that an off-duty officer happened to be passing by the station and managed to use a fire extinguisher to stop the blaze from spreading.
Mr McGinley (35), of Emmett Park, Castlefin, was arrested following a high profile Garda operation at Emmett Park, Castlefin on Saturday evening.
The court was told that clothing found at Mr McGinley's home matched that of the person captured on CCTV.
Detective Garda Robin Doyle of Lifford Garda station told the court that he charged Mr McGinley on Sunday at 5.17am. When charged, Mr McGinley replied: "I'm sorry."
Sergeant Collins said he was objecting to bail stating he feared the accused would go on to commit further serious offences if granted bail.
He added Mr McGinley had made "full and frank admissions" while being interviewed, but accepted the accused was not a flight risk.
However, Sgt Collins said the alleged offence was committed while Mr McGinley was on bail.
Solicitor for the accused, Patsy Gallagher, said he was seeking to have his client remanded to be assessed by the mental health services. He said his client had admitted the offence and there had been concerns for his welfare while he was in custody.
Sgt Collins said he was still objecting to bail stating it is a very serious matter, pointing out that the penalty was up to life imprisonment.
He added: "But for the grace of God, the station could have also been set alight but for fact that there was a member passing by, and he managed to control the fire."
Judge Éiteáin Cunningham refused bail on a number of grounds, including the seriousness of the charge, the strength of the evidence and the sentence likely to be imposed.
She ordered that Mr McGinley receive all medical help while on remand and that he be seen by both the psychological and psychiatric services in prison.
The case was adjourned to Thursday, January 26th.