TORONTO - Child pornography that police accidentally found on a man's computer while investigating him on fraud charges can be used in court, Ontario's highest court has ruled.

But, the court warned, it does not mean police have the right to poke into every corner of someone's computer under the guise of a specific search.

The police were investigating Ronald Jones in an Internet fraud and stumbled upon 57 images of child pornography. They asked a Crown attorney for advice, the lawyer said they could proceed with a further search, and the police also found 31 child pornography videos.

A lower court judge ruled that Jones' charter rights were violated because the warrant authorized a search for evidence of fraud, not of child pornography. That court dismissed his charge of possession of child pornography, but in a ruling released Tuesday, the Court of Appeal for Ontario ordered a new trial.

The police were entitled to seize the initial images they stumbled upon, under the so-called plain view doctrine, the three-judge Appeal Court panel ruled.

But, they said, it was a charter breach to go looking for more evidence of child pornography without getting a second warrant.

The Crown had argued that the initial warrant authorized the extended search because a computer is like pieces of physical evidence, which can be tested and inspected in whatever ways the police deem necessary once lawfully seized.

But the court rejected that, saying when a computer is seized for a specific reason, it does not give police carte blanche to pore through it to root out evidence of unconnected crimes.

"I do not accept that the right to examine the entire contents of a computer for evidence of one crime ... carries with it the untrammelled right to rummage through the entire computer contents in search of evidence of another crime ... without restraint," wrote Justice Robert Blair on behalf of the panel.

The police acted in good faith and balancing all the factors, it was wrong to exclude the pornographic evidence, the court said.

"The administration of justice would be brought into disrepute more, in the long-term, if the video file evidence is excluded rather than included," the court wrote.

"Crimes involving child pornography are among the most abhorrent in society. Society's interest in having these charges tried on their merits, with the important, reliable and real evidence that is available being tendered, is very high."