A judge has been forced to grant bail to the same "out of control" teenager for a second time in less than a week because the State's main juvenile detention centre was full.

The 16-year-old appeared before the Dublin Children's Court last Wednesday charged over raids at two corner shops in which staff members were attacked and beaten with a pole and a glass bottle.

However, the then presiding judge had to grant bail because there were no places available in Oberstown detention centre to hold the boy, who cannot be named because he is a minor.

The teenager was arrested on 5 February after his terrified mother contacted gardaí, who were waiting at his house when he arrived back after he allegedly tried to rob the second shop.

Following objections to bail two days later, Judge John O'Connor, then presiding, said the teenager was "a risk to himself, a risk to his mother and a risk to the public at large" and custody was warranted, however, bail had to be granted because the Oberstown facility was full.

The teenager, who promised his mother he would go straight home with her, was ordered to appear again the following morning on 8 February, but he did not show up.

A bench warrant was issued and he was arrested in Co Louth on Saturday.

He was brought back to the Dublin Children's Court today when Judge Timothy Lucey said the teenager was "out of control" and it was his finding that he must be remanded in custody.

However, following the lengthy bail hearing, a check was carried out and the judge was then informed that there was no still no place available in the detention centre to hold the boy. Bail had to be granted.

The teenager, was ordered to abide by a curfew at his mother's home and to remain out of the Dublin 2 area as a condition of bail.

Directions from the Director of Public Prosecutions are being sought. The case resumes next week.

After he was first granted bail last Wednesday, gardaí checked his home at 7pm and he was there but when they called back two hours later he was gone.

Tusla had closed their file on the teenager, the court had heard.

The court heard one of the shop owners closed up his business after learning that the teen would be getting released.

The teen is charged with theft, robbery, attempted robbery and assault causing harm, in connection with three incidents which happened over a four-hour period on 5 February in Dublin.

Gardaí objected to bail citing the seriousness of the incidents.

Garda Kevin Cassidy told the court that it was alleged two youths entered a shop at Mercer Street with their faces covered at 5.20pm.

The garda said it was a vicious incident and the teen had a pole and repeatedly used it beat the shop worker and continued striking him with it even after €150 from the till was handed over.

It was also alleged he was armed with a syringe.

It was alleged the teen went home and changed clothes and left again, however his mother then alerted the gardaí who went to the house.

They saw the clothes which matched the description they had from the raid at the shop on Mercer Street.

It was alleged at 6.55pm the masked teen entered a shop at Bride Street and during an attempted robbery he repeatedly beat an employee with a glass bottle.

The court heard that the boy fled but when he arrived home Garda Cassidy was still there and he was arrested.

It was alleged that the teenager was involved in the robbery of a bag at St Stephen's Green at around 3pm on the same date.

His mother also raised concerns about his violence in the home.

When he was taken for questioning last week he admitted to gardaí he had used cocaine, cannabis and Xanax as well a large volume of alcohol on a daily basis.

The interview had to be suspended to allow him get medical treatment.

The court heard that when he was picked up in Co Louth at the weekend medical attention was again required.