Image copyright Reuters

Canada's top court has found a teacher guilty of voyeurism for taking pictures of his teenage students' cleavage.

Ryan Jarvis, who filmed his students using a camera pen, had been acquitted by two lower courts.

In his first trial, the judge ruled it could not be proved the photos were taken for a sexual purpose.

But the Supreme Court of Canada ruled Thursday that students have a right to expect that their bodies will not be photographed in school.

Voyeurism is a sexual offence in Canada. The legal definition hinges on the assumption that the victim has a reasonable expectation of privacy.

The first court had acquitted 41-year-old Jarvis after the judge ruled it could not be proved beyond a reasonable doubt that the photos were taken for a sexual purpose.

A lower court of appeal ruled they were taken for a sexual purpose. But the court upheld Jarvis's appeal when it found the students' had no reasonable expectation of privacy at school.

But the Supreme Court found the issue of whether the photos were taken for an explicitly sexual purpose was not as important as whether the photos violated their sexual integrity.

Writing for the bench, Justice Richard Wagner said students have a "reasonable expectation of privacy regarding how their bodies would be observed in the classrooms and hallways of their school".

Media playback is unsupported on your device Media caption "He was laughing": Three women tell the BBC's Victoria Derbyshire about their experience of upskirting

Now that the criminal ruling has been issued, the Ontario Teachers' College can continue with its professional disciplinary hearing.

Jarvis' licence to teach was suspended in 2013 for failing to pay his dues. There is no record of disciplinary findings against him, according to the Ontario College of Teachers.

Jarvis, who taught high school English, was charged with voyeurism after police discovered he secretly photographed 27 female students ages 14 to 18 between the years 2010-2011.

Justice Wagner said the ruling will make way for future "upskirting" cases to be prosecuted.

New technologies like camera phones and drones have brought legal issues around privacy and voyeurism to a head, Judge Wagner wrote.

"The use of a cell phone to capture upskirt images of women on public transit, the use of a drone to take high-resolution photographs of unsuspecting sunbathers at a public swimming pool, and the surreptitious video recording of a woman breastfeeding in a quiet corner of a coffee shop would all raise similar privacy concerns," he wrote.

Media playback is unsupported on your device Media caption 'I forgive the man who upskirted me'

Upskirting became a criminal offence in England and Wales this week, after an 18-months-long campaign.

Theresa May welcomed the change in the law in a tweet.