Canada's highest court heard an appeal Tuesday focusing on a drug-sniffing dog that uncovered five bags of marijuana and 10 magic mushrooms in the backpack of an Ontario high school student during a police sweep.

At issue is whether the unannounced police visit to the school in 2002 amounted to an unreasonable search under the Charter of Rights.

The incident launched a five-year court battle over privacy rights that has gone all the way to the Supreme Court of Canada.

A decision is expected next fall in a case that will help determine whether police can use sniffer dogs to conduct random searches at schools and other public places including malls, parks, sport arenas and beaches.

The court will decide whether the unannounced police visit to St. Patrick's high school in Sarnia, Ont. on November 2002 amounted to an unreasonable search and seizure under the Charter of Rights.

Students spent nearly two hours in their classrooms while dogs patrolled the halls.

The teen, known only as A.M., was charged with marijuana trafficking after police found five bags of marijuana and 10 magic mushrooms in his bag.

He was later cleared by two courts on the grounds police had violated his right to be free from unreasonable search and seizure.

"Chef" the dog's handler acknowledged he had no grounds for obtaining a search warrant beforehand and no direct knowledge of drugs inside the school.

Several lawyers argued bringing sniffer dogs into a school was too heavy-handed, and infringed on student's privacy rights.

"In the post-9/11 era the security of the state, in my opinion, is taking precedence over the autonomy of the individual," lawyer Alias Sanders told Â鶹´«Ã½.

"I think principals have and need to have the power to make sure their school is safe, they are the people who know what's going on in the school," said Martha MacKinnon, executive director of Justice for Children and Youth, a legal aid clinic that acts on behalf of children.

"What they don't need is to just give the police carte blanche to come in and do as they like," she added.

But lawyers for the police and school board said students were warned about the possibility of drug searches.

"Through that consultation they arrived at a policy of zero tolerance of drugs," said Public Prosecutions Service Canada lawyer Jolaine Antonio. "Parents were informed of possibility of all kinds of observations being made including ... dogs being brought into the school."

The Court of Appeal ruled the search caused some concern and it upheld a trial judge's decision to acquit A.M. of his charge.

"This was a warrantless, random search with the entire student body held in detention,'' the court stated in their ruling last year.

Admitting the drugs into evidence would strip A.M. and any other student in a similar situation of their right to be free from unreasonable search and seizure, the court said.

The Crown is disputing there was no actual search, claiming there are no privacy issues attached to searches of smells in the public air.

"A dog sniff alone is not a search; it only supplies information that may lead to one,'' lawyers Robert Hubbard and Alison Wheeler said in submissions filed with the Supreme Court on behalf of Ontario's attorney general.

Lawyers Frank Addario and Emma Phillips warned in a brief filed on behalf of Ontario's Criminal Lawyers' Association that the decision could have serious repercussions.

Their brief stated excluding "emissions'' from personal belongings from Charter protection could lead to police intrusions including the monitoring of sounds coming from inside houses and communications from wireless technology.

The Civil Liberties Association contended in their brief that the real issue is "what the police were doing in the school in the first place and how they came to apply their dog's snout to the backpacks of students who had been confined to their classrooms.''

The initial search breached school board policy, which states, police are only to be used as a last resort and all searches are to be directed by teachers.

With a report from CTV's Rosemary Thompson