A burglar and an "associate" flagged down a taxi after a house break-in, then were held at the scene by the taxi man and the victims, it has been alleged.
According to gardai, the two men were "apprehended" after they returned in the taxi to the house, where the associate retrieved a bag of stolen goods worth €1,800 that had been left in a hedge.
Bernard Kelly (38), of Cashel Road, Crumlin, was granted bail when he appeared in court charged with burglary.
The offence is alleged to have happened at Templeville Road, Terenure, in the early hours of Sunday.
Objecting to bail, Garda Ciaran O'Brien told Dublin District Court it was alleged a burglar entered the house through an open ground-floor window at around 2am, while most of the occupants were home and sleeping.
They were disturbed by the sound of rummaging coming from downstairs.
It was alleged that Mr Kelly and another man flagged down a taxi at nearby Wainsfort Road and asked the driver to take them to the same address on Templeville Road en route to Crumlin.
On arriving, it was alleged, Mr Kelly's "associate" asked the driver to stop and got out of the taxi.
This man took a bag from the hedge of a neighbouring garden and, at this point, some of the alleged victims came out and approached the taxi.
They recognised the bag as their own and the accused was apprehended by the taxi driver and the alleged victims, Gda O'Brien said.
One of the occupants of the house had come home from socialising just as the burglary concluded, the garda added.
It was alleged this man saw the accused at the bushes, and earlier walking away from the house, and recognised him in the taxi.
The value of the property stolen, including a television, was €1,800.
Mr Kelly would deny that he was part of the burglary, his solicitor Michael Kelleher said, applying for bail. He had a very bad hearing problem and would make a "very poor burglar", Mr Kelleher told Judge Grainne Malone.
Mr Kelly then gave evidence to the court that on the night, "me and my missus were after having a row" and he went out walking for two to three hours to clear his head because it was "wrecked".
He said he bumped into a man who was looking for a lift and they got a taxi.
After the taxi stopped, this man got out and Mr Kelly said he was surrounded by five people and pulled out of the car.
"There is no way I had any involvement in that crime whatsoever, not an inch of it," he said.
"I was in the wrong place at the wrong time. I'm an innocent man."
The court heard that he and his partner had a newborn baby, and his partner also had three children from a previous relationship.
Judge Malone set bail for Mr Kelly at €100 cash, plus an independent surety of €250, and remanded him in custody with consent to bail until Friday.
Among the conditions of bail are that he observes a curfew, signs on daily at his local garda station and stays out of Dublin 6.
Another accused man, Shane McDonnell (28), also from Cashel Road, Crumlin, was refused bail when he appeared in court charged in connection with the alleged burglary.
Another garda told the court that the co-accused, Mr McDonnell, had replied: "I didn't enter the building," when he was charged.
In his case, the garda said that when interviewed, Mr McDonnell had made admissions to "keeping watch" while the house was broken into and to handling items that were stolen.
It was alleged he was apprehended outside the house in possession of a stolen laptop and PlayStation 4.
Mr McDonnell disputed making any of those admissions in interview, his barrister Garrett Casey said. Judge Malone refused Mr McDonnell bail and remanded him in custody, to appear at Cloverhill District Court on Thursday.