OTTAWA -- The police need a search warrant to get information from Internet service providers about their subscribers' identities during investigations, the Supreme Court of Canada says in a landmark ruling affirming Canadians' right to online privacy.

The high court's landmark 8-0 ruling on online privacy issues came in the appeal of a Saskatchewan man facing child pornography charges. The court affirmed that when Canadians surf the web, they should be guaranteed a degree of anonymity.

The ruling also has political implications for the federal government's current cyber-bullying bill, setting the stage for another clash between the Harper government and the Supreme Court.

The ruling deals with a 19-year-old Saskatchewan man who was charged with possessing and distributing child pornography after police used his Internet address to get further details from his online service provider, all without first obtaining a search warrant.

Lawyers for the man argued that violated his constitutional right to be protected from unlawful search and seizure.

But in this specific case, the Supreme Court ruled that the details gathered should not be excluded as evidence from the man's trial, saying the police acted in good faith.

"A warrantless search, such as the one that occurred in this case, is presumptively unreasonable," Justice Thomas Cromwell wrote for the court.

"The Crown bears the burden of rebutting this presumption."

The ruling also addressed the broader constitutional issues raised by Section 8 of the Charter of Rights and Freedoms, which protects Canadians' privacy rights from unlawful search and seizure.

"In my view, in the totality of the circumstances of this case, there is a reasonable expectation of privacy in the subscriber information," Cromwell wrote.

"The disclosure of this information will often amount to the identification of a user with intimate or sensitive activities being carried out online, usually on the understanding that these activities would be anonymous."

Friday's ruling renders unconstitutional a portion of the Tories' cyber-bullying bill, C-13, which critics say will encourage companies to give police more information about customers' online activities without a warrant. It may also have implications for a separate digital privacy bill, also before Parliament.

New Democrat MP Peter Julian called on the government to amend the bills in light of the Supreme Court ruling.

"The Conservatives are streamrolling ahead with Bill C-13, which also allows unconstitutional spying on Canadians," Julian said in the House of Commons.

"With yet another bill struck down by the Supreme Court, when will they finally take a balanced approach that keeps Canadians secure without infringing on constitutional rights?"

Conservative MP Bob Dechert, the parliamentary secretary to Justice Minister Peter MacKay, replied that the government will review the decision.

"We always respect the work of the court. We will continue to crack down on cyber bullies and online criminals to keep children and vulnerable communities safe in Canada," he said.

Commons committee hearings on the bill wrapped Thursday, and it will now go to third reading and onto the Senate. It wasn't clear yet Friday what the government's next moves would be -- either amending the bill before it clears the Commons, or doing so later in the Senate.

In a statement, Justice Minister Peter MacKay said the court's decision "has clarified the law in this area. We will review this decision and respect the ruling." His office provided no further clarification.

OpenMedia.ca Executive Director Steve Anderson hailed Friday's ruling as historic and said it will force the government to cut "their extreme spying provisions" from C-13.

"Tens of thousands of Canadians have worked tirelessly to raise the alarm over how this government has been conducting warrantless surveillance of law-abiding citizens on a massive scale," Anderson said in a statement.

"All along we've said the government's online spying Bill C-13 is reckless and irresponsible and today's ruling vindicates those concerns."

Michael Geist, a University of Ottawa law professor who specializes in digital issues, said the ruling will force Internet service providers to change their practices on voluntary warrantless disclosure, saying the ruling "seems likely to define Internet privacy for many years to come."

The road to Friday's ruling began in 2007 when Matthew David Spencer was charged with downloading child pornography using peer-to-peer file sharing software. The police found the files after Spencer stored them in a shared public folder.

The police approached Shaw Communications without a search warrant, and asked for the information behind Spencer's Internet Protocol address.

Shaw obliged, giving police information that pointed to Spencer's sister.

Police then got a search warrant for the woman's residence and seized her brother's computer, leading to his arrest.

The Supreme Court ruled that the information gathered on Spencer without a warrant was nonetheless admissible, but should not "be understood to be encouraging the police to act without warrants in 'grey areas."'

"In short, the police were acting by what they reasonably thought were lawful means to pursue an important law enforcement purpose. There is no challenge to any other aspect of the information to obtain the search warrant," the court ruled.

"The nature of the police conduct in this case would not tend to bring the administration of justice into disrepute."

Privacy commissioner Daniel Therrien and the Canadian Bar Association have recommended that the cyber-bullying bill be split in two, with one bill covering cyber-bullying and another focusing on lawful-access provisions.

Civil libertarians also argue that the cyber-bullying bill will undermine Internet privacy, by making it easier for government to snoop on the online activities of otherwise law-abiding Canadians.

But the government contends a 21st century law is needed to help authorities catch pedophiles and other criminals who pose threats online.