WASHINGTON (CN) — Agreeing with a nursery school, a federal judge ruled Thursday that the District of Columbia’s random drug screening policy violates teachers’ civil rights.

The policy requires prehiring drug screening and random drug screens during employment. It is rooted in the Child and Youth Safety and Health Omnibus Amendment Act of 2004, enacted to fight the “tragic effects of drug or alcohol permeating youth group homes,” according to a 2004 D.C. Committee on Human Services report.

In 2013, after years of neglecting the policy, D.C.’s Office of the State Superintendent of Education, which licenses nurseries, issued a memorandum to facilities that they would be subject to the rule and lose their license if they failed to abide.

But it didn’t take long for the River School, a private school with fewer than 200 students, many of them with ocular implants, to challenge the part of the rule that requires random drug screens.

The school, two teachers and the private school advocacy group Association of Independent Schools of Greater Washington claimed that random drug screening rule violated the Fourth Amendment.

U.S. District Judge James E. Boasberg agreed Thursday.

“Such testing, courts have repeatedly held, presents a unique risk to personal privacy,” Boasberg wrote, going on to quote precedent that random screens are different from pre-employment screens because “the individuals who will be tested are not applicants for jobs, but are employees, whose privacy interests are greater than applicants.”

The D.C. office had argued there was a long history of random drug screens in heavily regulated industries, such as railroad workers. But Boasberg questioned the link between working on a railyard and monitoring infant children.

“Although ‘heavy regulation’ may counsel in favor of finding a reduced privacy interest in sectors involving ‘the operation of heavy machinery or means of mass transit. … Defendants fail to show that this premise extends to the supervision of educators or childcare providers,’” the ruling states. “The court finds that such providers … retain a robust expectation of personal privacy.”

Nancy Mellon, who founded the River School in 1999 and has been its head of school ever since, said in an interview she was thrilled by the judge’s decision. She said the fight was spurred by the district’s sudden and “heavy-handed” application of policy.

Mellon questioned the district’s requirement that testing occur at its facility, noting this would mean pulling teachers out of class and away from students.

“We’re all incredibly well-staffed because of [the OSSE’s other policies],” she said. “The best way we can protect children is keeping teachers, in classrooms, teaching and monitoring children and not sending them out of the classroom for screenings that are unnecessary.”

As for those who might be concerned that the policy was about allowing nursery school teachers to get away with smoking pot, she said there was no evidence showing there was an issue in the first place.

“It’s a solution in search of a problem,” she said.

A representative of D.C.’s Office of the State Superintendent of Education has not responded to questions.