A high school teacher who secretly recorded his female students’ chests with a camera hidden in a pen committed voyeurism, the Supreme Court of Canada ruled Thursday.

Ryan Jarvis was arrested after police learned that he had made recordings of conversations he had with 27 female students in 2010 and 2011, while he was working as an English teacher at a high school in London, Ont.

As he talked to the students, all of whom were between the ages of 14 and 18, he was covertly recording them via a camera hidden in his pen and pointed at their chests.

Two lower-court judges had previously found Jarvis not guilty of voyeurism. His trial judge said the Crown had not proved that Jarvis had sexual motivations when he took the videos. The case was taken to the Ontario Court of Appeal, which found clear sexual intent but let Jarvis off because, in its view, the students had no reasonable expectation of privacy while at school.

In delivering its decision, the Supreme Court said the appeal hinged on whether the students could “reasonably expect” not to be recorded by Jarvis while talking to him. Jarvis had argued that there was no such expectation because the recordings were made in common areas of the school, where the students knew other people could be looking at them.

The court did not buy that argument, comparing the students to women in a changeroom at a public pool. Those women could reasonably expect that other people might see them undressing, the court said, but could not reasonably expect that they might be recorded in secret.

“A student attending class, walking down a school hallway or speaking to her teacher certainly expects that she will not be singled out by the teacher and made the subject of a secretive, minutes-long recording or series of recordings focusing on her body,” the decision reads.

The court also noted that Jarvis’ role as a teacher put him in a position of trust with the students and drew a distinction between his pen camera and the more visible surveillance cameras in place at the school. The Ontario Court of Appeal had used the presence of those surveillance cameras to justify its argument that students should not have expected privacy.

“Everybody knew that there were cameras in the classroom. What they didn’t know is that the teacher had one in his pocket and was utilizing it in this way,” CTV News legal analyst Edward Prutschi told CTV News Channel following the decision.

But even the country’s top court was split on the legalities of the case, with three of nine judges delivering a dissenting opinion. The three judges still found that Jarvis had committed voyeurism, but argued that the other judges erred in considering factors such as Jarvis’ relationship to his victims and his use of technology. Those factors should only be taken into account for sentencing, they argued, and not for a finding of guilt.

Prutschi said the split opinions on the Supreme Court helps illustrate the complexity of the case and why two lower courts were unable to find Jarvis guilty, despite believing he had taken the covert recordings.

“What many Canadians probably think should have been a simple answer is actually not all that simple in law,” he said.

Barb MacQuarrie, who is the community director of a Western University research centre focused on violence against women and children, said the lower court decisions sparked “a lot of concern,” which turned to relief with news of the Supreme Court ruling.

“The sexual intent of the videoing was obvious to most of us, as well as the need to ensure students’ privacy in school,” she told CTV News Channel.

Jarvis will be sentenced at a later date. A voyeurism conviction carries a maximum sentence of five years in prison.

He also faces a disciplinary hearing from the Ontario College of Teachers for alleged offences including sexual abuse of students, psychological or emotional abuse and unprofessional conduct. He has agreed not to teach until that hearing is complete.

Prutschi said Thursday’s decision would likely have a significant impact on future privacy-related legal issues in Canada.

“What it’s telling us is that it’s not a black-and-white issue, this question about what can be done in public,” he said.

“Next time we’re talking about a privacy case – whether that’s audio surveillance, whether that’s how police become involved in searches that take place outside of a person’s home or car – we’re going to be probably utilizing this holistic approach.”