A former Dublin City Council worker is alleged to have been part of a gang that drove a jeep through the front door of a credit union and demanded money from staff.
Mark McMenamin (35) and his two accomplices were foiled in the robbery by an off-duty garda who was in Rathfarnham village at the time.
The officer said he witnessed the gang's jeep smash through the front of the office.
Gardai later claimed McMenamin violently threatened staff and told them to hand over money, a court was told.
But he and his accomplices were said to have driven away without any cash, as gardai were quickly on the scene.
The men were followed by gardai and were allegedly confronted at Riverside Drive, Rathfarnham, where a number of shots were fired.
A court heard that gardai issued an arrest warrant for McMenamin in November, as the DPP had given directions that he should be charged in relation to the attempted robbery.
The accused walked into Ronanstown Garda Station on Wednesday and handed himself in to gardai.
Mr McMenamin, of Pearse House, Dublin 2, and Tara Hill Road, Rathfarnham, appeared before Tallaght District Court charged with the attempted robbery of Rathfarnham Credit Union on December 12, 2008.
Detective Garda David Connolly objected to bail, citing the seriousness of the offence.
The detective alleged that Mr McMenamin and his accomplices used a jeep to smash through the front of Rathfarnham Credit Union, which had just closed for the day.
The men, who were wearing boiler suits and balaclavas, demanded money from staff.
Gda Connolly said gardai were quickly on the scene, and the men drove away without any money.
He alleged that the men drove through Rathfarnham village and through a fence into Castle Golf Club, before stopping at Riverside Drive, where they were confronted by gardai.
A number of shots were fired by armed gardai.
Gda Connolly alleged one of the men escaped on foot, a second in the jeep and Mr McMenamin in another getaway car.
The court heard that gardai conducted an extensive investigation, which included a detailed technical examination of the scene.
Mr McMenamin's defence lawyer said the client was willing to abide by any bail conditions, would lodge a €3,000 cash surety and would sign on twice daily, if necessary.
Mr McMenamin said he would obey a curfew, and even stay under house arrest, saying his girlfriend is pregnant and he wants to be with her.
Judge David McHugh refused bail and remanded Mr McMenamin in custody to appear in Cloverhill District Court on Thursday.