A homeless man spotted by a priest climbing 30ft up scaffolding to the rear of a cathedral had left his phone charging in the building and was trying to retrieve it, a court has heard.
Tony O'Brien, who now lives at Rathravane in Ballydehob in Co Cork, was also spotted by gardaí trying to gain entry to a garda station by walking along a high wall.
Mr O'Brien, 30, appeared before Clonakilty District Court where he pleaded guilty to two charges.
Judge James McNulty was told that in the first incident at 6.20pm on May 9 last a garda on duty at Dunmanway garda station said he observed a male climb up a wall at the rear of the station before then walking along the top of it.
The garda directed Mr O'Brien to leave and that he was trespassing into an area mot open to the public.
Mr O'Brien's solicitor, Conrad Murphy, said there was a certain sum of money at the garda station under investigation and Mr O'Brien had knocked on the front door and when there was no answer had walked around to the back of the building and walked up along the wall.
"He shouldn't have done that," Mr Murphy said.
Then on May 19 last at 6.30pm gardaí received a call from the local priest at St Patrick's Cathedral that he could see a male climbing scaffolding to the rear of the building.
In subsequent statements the priest and another member of the church made statements claiming the man had tried to gain entry and had been 30ft up the scaffolding.
Mr O'Brien had one previous conviction and Mr Murphy said his client had experienced some difficulties which he was overcoming.
Mr Murphy said Mr O'Brien had been homeless at the time and in relation to the Church incident he had left his phone charging but when he went back to retrieve it the doors were locked.
"There was no intention here of stealing anything or doing anything," Mr Murphy said, adding that his client apologised to gardaí and anyone else affected.
Judge McNulty said he would grant Mr O'Brien a conditional discharge so he would be under the supervision of the Probation Service for the next 12 months.