A Texas judge who lost re-election released almost all the juvenile defendants that appeared before him Wednesday, a move that drew criticism from local prosecutors.

Judge Glenn Devlin, a juvenile court judge in Harris County, Texas, simply asked his defendants whether they planned to kill anyone before approving their release, the Houston Chronicle reported.

It was not immediately clear how many defendants were released, but the Chronicle reported at least seven. Their charges ranged from misdemeanors to violent crimes.

"'If I release you, will you go out and murder anybody?' And so, if the juvenile said 'No,' they were released," public defender Steve Halpert told KTRK-TV about the hearing. "Judge Devlin would never normally ask that question of a juvenile. This was unusual."

Halpert was requesting release for his client, according to the TV station.

The Chronicle reported that the youth's cases would be heard again, once Natalia Oakes, the Democrat who defeated Devlin on Tuesday, takes the bench in January.

In a statement, District Attorney Kim Ogg slammed the decision saying it "could endanger the public."

"We oppose the wholesale release of violent offenders at any age," Ogg added.

Devlin didn't comment to either the Chronicle or KTRK-TV.

All three juvenile judges in the county lost to Democrats on Tuesday, according to the Chronicle. Halpert told KTRK-TV he thought Devlin's actions were "a post-election weird blip."

"He made a comment, 'This is obviously what the voters wanted' and I think there's an implication by electing all Democratic judges, there's this belief that Democratic judges are going to be soft on crime," Halpert told the TV station.

Contributing: The Associated Press.