A divided Supreme Court of Canada says police can conduct a limited search of a suspect's cellphone when they are arrested without getting a search warrant, but they must follow strict rules.

In its precedent-setting, 4-3 ruling, the country's top court said Thursday that the search must be directly related to the circumstances of a person's arrest and the police must keep detailed records of the search.

Three dissenting justices said the police must get a search warrant in all cases except in rare instances where there is a danger to the public or the police, or if evidence could be destroyed.

It is the first time the Supreme Court has ruled on cellphone privacy, an issue that has spawned a series of divergent lower court rulings.