A 14-year-old boy accused of shooting two men on a Red Line platform during rush hour has been released to his parent on Friday over the demands of prosecutors.

The boy was released after a juvenile court judge said he was held by Chicago police beyond the legal limit for minors, according to the Cook County state’s attorney’s office.

Minors must be brought before a judge within 24 hours of their arrest, but the 14-year-old was held for twice that amount, according to prosecutors.

“At today’s detention hearing, we requested the minor be held in custody,” the state’s attorney’s office said in a statement. “Over our objections, the minor was released to the custody of a parent.”

Prosecutors asked for the boy to be placed on electronic home monitoring, but the Judge Linda Pauel denied the request, the state’s attorney’s office said.

The juvenile was charged on Thursday of two felony counts of attempted first-degree murder and aggravated battery with a firearm after a shooting on a Red Line platform in Uptown, Chicago police said.

The juvenile and another male allegedly entered the Argyle station about 4 p.m. Monday and unleashed gunfire on two men, police said.

A 34-year-old was critically wounded by multiple gunshots, police said. He was struck in the back, abdomen, groin and buttocks. The other man, 41, was grazed by a bullet and declined medical attention. No bystanders were hit.

Red Line service was suspended for almost four hours while police investigated the scene.

The juvenile was one of two people arrested and questioned Wednesday about the shooting. The second person questioned was released without charging, police said Thursday.

The boy is schedule to appear in juvenile court again on May 13.

Read more on crime, and track the city’s homicides.