A Kentucky sheriff’s deputy who handcuffed an 8-year-old boy and 9-year-old girl at school violated the children’s constitutional rights, a federal judge ruled, labeling the move “excessive force” and an unnecessary reaction to their misbehavior.

The American Civil Liberties Union, which filed the lawsuit on the children’s behalf, said last week’s ruling vindicates its position that schools should not use police officers to deal with misbehaving students, particularly children with disabilities. The children who were handcuffed had been diagnosed with attention-deficit/hyperactivity disorder, a condition that made it difficult for them to focus and follow instructions.

“This judge drew a line in the sand and said this conduct is unconstitutional, and we think that this is helpful in our efforts to advocate against the criminalization of children,” said Claudia Center, a senior staff attorney with the ACLU. “It’s a terrible policy from our view, particularly in elementary schools.”

Neither the sheriff’s office nor the county attorney’s office in Kenton County returned calls for comment. The sheriff’s deputy named in the case, Kevin Sumner, could not be reached for comment.

School police officers have been scrutinized in recent years for the role they have played in enforcing order in schools. School police officers say they help keep schools safe, but critics say that some use brutal tactics to deal with school discipline matters, criminalizing routine misbehavior.

Special education students are more likely than other youngsters to be restrained in school, including with handcuffs. According to federal data, school personnel or police officers mechanically restrained nearly 6,000 students in the 2013-2014 school year, the latest year for which such data is available. Nearly 33 percent of them were special education students, even though that group represented only 14 percent of student enrollment that school year.

According to court documents, staff at two elementary schools in Kenton County summoned Sumner, the sheriff’s deputy, to deal with the children after they misbehaved and hit teachers, encounters that ended with Sumner cuffing the children above their elbows and cinching the cuffs so tight it hurt them.

Sumner handcuffed the girl on two separate occasions in fall 2014 and the boy once in the same period, despite a school policy prohibiting school staff from handcuffing students. Sumner’s supervisor testified that the sheriff’s deputy acted in accordance with his training and that the policy did not apply to law enforcement in schools.

According to court documents, school personnel summoned the sheriff’s deputy after the boy, identified as S.R. in the lawsuit, had disrupted class, run away from the principal and kicked a special-education teacher. School staff videotaped the encounter between Sumner and the boy, who was 4 feet tall and 54 pounds.

“You don’t get to swing at me like that,” Sumner told the boy, as he placed the ring of the cuffs on the boy’s skinny biceps. He cinched the chain between the cuffs tighter, forcing the boy’s arms together behind his back. “You can do what we ask you to do, or suffer the consequences.”

“Ow! That hurts!” the boy yelled. He continued to cry and squirm in the chair, kicking his feet.

U.S. District Judge William O. Bertelsman wrote in his ruling that although the boy had swung at the sheriff’s deputy, his actions “can hardly be considered a serious physical threat from an unarmed, 54-pound 8-year-old child.”

Bertelsman ruled that Kenton County could be held liable for the sheriff deputy’s conduct. The lawsuit is set to proceed to trial, where a jury will determine damages. The judge rejected the claim that the children had been targeted or treated differently because of their disability, pointing out that their parents had not told school staff about their diagnoses.

The Kentucky lawsuit also spurred a Justice Department investigation of the Kenton County School District, which in January agreed to new policies to ensure discipline practices do not discriminate against children with disabilities, according to the ACLU.