A Texas judge lost his re-election bid to a Democrat, so he released almost every juvenile defendant who appeared in front of him for a detention hearing.

Houston Judge Glenn Devlin reportedly made each child promise they wouldn’t kill anyone before he allowed them to walk free, according to The Houston Chronicle.

Public defender Steven Halpert said Devlin used his election loss to justify his decision. Halpert said Devlin’s behavior was strange because he is usually tough on people who appear in front of him. Devlin is one of the judges responsible for sending one out of five juvenile offenders to state prison.

"I just think this was 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 KTRK.

Halpert says only one juvenile remained in custody when Devlin was done. Four of the released youths were facing aggravated robbery charges. In total, 10-12 defendants were released.

Harris County District Attorney Kim Ogg said Devlin’s decision could “endanger the public.”

Devlin reset every case from Wednesday until January 4, when his successor Natalia Oakes takes over. She was also critical of Devlin’s actions.

"I would not have expected that from a professional," Oakes said.

Now, check these out:

These Are The Winning Black Candidates Of The Midterm Election

Democrats Promise To Use House Majority To Investigate Donald Trump

Jeff Sessions Is Out As Attorney General