Image copyright Harris County Juvenile Probation Dept/Facebook Image caption The ACLU has called for an investigation citing the judge's "improper" actions.

A tough Texas judge has released a group of defendants, reportedly saying it was what voters wanted, a day after he lost his re-election bid.

Republican Judge Glenn Devlin let seven juvenile defendants go on Wednesday - including some charged with violent crimes, according to local media.

Witnesses said that before releasing the defendants he asked them if they planned to kill anybody.

The American Civil Liberties Union (ACLU) is demanding an investigation.

The Harris County District Attorney Kim Ogg has condemned the jurist's actions.

She told the BBC in an emailed statement: "We oppose the wholesale release of violent offenders at any age; this could endanger the public."

Public Defender Steve Halpert told ABC 13 that when Judge Devlin took the bench on Wednesday, he asked the juvenile defendants before him: "If I release you, will you go out and murder anybody?"

"If the juvenile said 'no,' they were released," Mr Halpert said. "Judge Devlin would never normally ask that question of a juvenile. This was unusual."

According to the Houston Chronicle, the defendants face charges ranging from misdemeanours to violent crimes, and prosecutors in court at the time expressed concern at the releases.

According to Mr Halpert, Judge Devlin commented: "That's what the voters wanted."

The judge has not responded to multiple requests for comment.

The cases will be heard again on 4 January, when Judge Devlin's replacement, Natalia Oakes, takes the bench.

The ACLU, a civil liberties watchdog, has called on the Texas Commission on Judicial Conduct to look into the matter.

In a statement, Sharon Watkins Jones, of the Texas ACLU, said: "It is improper for a judge to make orders motivated by partisan interests or spite as a result of his political loss."

Judge Devlin was one of 59 Republican jurists who lost their seats to Democrats on Tuesday, including all three juvenile court judges, the Chronicle reported.

Last month, an investigation by the newspaper found that Judge Devlin and one other judge had sent to prison more than one fifth of all juveniles locked up last year.