A father-of-two facing a cocaine dealing charge asked not to be refused bail as he suffered medical problems from an injury he sustained in a shooting several years ago.
Michael O'Driscoll's lawyer raised concerns over his health in prison if he were remanded in custody.
Judge Bryan Smyth granted him bail and adjourned the case at Dublin District Court.
Mr O'Driscoll (37) of Bally- bough House, Dublin 3, is charged with possession of cocaine with intent to sell or supply at another address at Ballybough House on July 7.
The court heard the accused replied after caution: "How am I getting charged when there were six people there?"
Gardai objected to bail.
The court heard that in an unrelated incident a number of years ago, the accused was shot and suffered serious abdominal injuries.
These were life-threatening, and the accused still had ongoing problems, his solicitor Yvonne Bambury said.
The accused and his partner had two young children, she told the court.
Mr O'Driscoll was one of six people present at the address on the charge, and nobody else was arrested.
"He has issues in relation to the manner in which he was chosen to be charged," Ms Bambury said.
She was "concerned about him in the prison population" given his medical problems.
Judge Smyth granted bail on condition he stays away from Ballybough and signs on three times a week at Store Street Garda Station.
The case was adjourned for the directions of the DPP.
The judge also made a disclosure order at the request of the defence and granted free legal aid after hearing Mr O'Driscoll was on disability benefit.