A suspected intruder in an apartment complex who was confronted by a passer-by knocked the man unconscious with a punch, breaking his jaw and robbing him of his phone, a court was told.
Paul Burnett (33) is accused of assaulting and injuring the man, who got up off the ground, followed him and held him until gardaí arrived.
Judge Deirdre Gearty granted him bail despite garda objections and adjourned the case at Dublin District Court.
Mr Burnett, of Annamoe Drive, Cabra, is charged with assault causing harm to the man, robbing him of his mobile phone and trespassing.
The court was told the incident happened at Cross Guns Quay apartments in Phibsboro on July 23.
Objecting to bail, the prosecuting garda said the alleged victim had accused Mr Burnett of trying to steal a bicycle from the complex.
Mr Burnett punched the man in the face, knocking him out and to the ground. He suffered a fracture to his jaw, the court heard.
The garda said the accused stole the man's phone and ran off before being stopped by the alleged victim, who detained him and waited for gardaí to arrive.
The man said he saw the accused discard the phone by throwing it on to the roof of a shed at Shandon Lane.
Gardaí called the number and heard it ringing.
The garda alleged the accused was caught red-handed less than 200 metres from the scene.
Questioned by the defence, the officer accepted it was the alleged victim who first approached the accused.
The defence said the accused suggested he was taking a "short-cut home", that the alleged victim hit him first and he had a black eye.
He said proposed witnesses in the case all knew each other and "chased Mr Burnett in a van".
Under bail conditions, the accused must sign on at a garda station and stay out of the area of the alleged offences except for reasons agreed by the court.
He is to have no contact with the alleged victim.