A man allegedly broke into a neighbour's home to attack him with a PVC door frame, the High Court heard today.
Daryl O'Hagan is accused of striking the man about the head during an assault in Derry.
Prosecutors claimed the 27-year-old defendant was discovered hiding in a cupboard nearly a week later, with 60 suspected diazepam pills on him.
O'Hagan, of Moore Street in the city, was granted bail but excluded from its Waterside area.
He faces charges of aggravated burglary attempting to inflict grievous bodily harm, possessing an offensive weapon in a public place, criminal damage, common assault, resisting police and having Class C drugs.
Crown lawyer Kate McKay said police were alerted to ongoing violence in Moore Street on August 26.
O'Hagan was not present when officers arrived, but the alleged victim claimed he had forced his way into the property and attacked him.
"He further stated that the applicant returned with a piece of white-coloured PVC doorframe and assaulted him again by hitting him around the head," Mrs McKay said.
The man sustained red marks in the alleged incident, the court heard.
O'Hagan was arrested on September 3 after being found in a cupboard at another property, according to the prosecution.
Sixty blue tablets were said to have been located on him.
Defence counsel Sean Doherty confirmed his client and the alleged victim live on the same street.
He argued that a week before the incident O'Hagan told police that the other man had assaulted him and taken his mobile phone.
"This allegation (of aggravated burglary) is a transparent attempt to encourage this applicant to withdraw his complaint," Mr Doherty contended.
Granting bail for O'Hagan to live at another location, Mr Justice Treacy also banned him from having any contact with the alleged victim.