TORONTO -- Residents of condominiums have a reasonable expectation of privacy in the common areas of their buildings, Ontario's top court ruled Tuesday.

In upholding the acquittal of an accused drug trafficker, the Court of Appeal said police had breached his rights by snooping around the stairways, hallways and storage rooms of his 10-unit building without a warrant.

"Some limits on police activity are necessary if privacy is to be protected," the court stated.

"The home is entitled to the greatest degree of protection from unreasonable search, and in my view, the police conduct in this case had a serious impact on the respondent's privacy rights."

The case began with police tracking a suspected drug trafficker, who led them to the building in Ottawa where Merith White was a resident. They suspected White was also dealing drugs. As part of their investigation, police made three secret entries into common areas of the four-storey building in December 2010 and January 2011.

Once inside, a detective hid in the stairwell to watch White's unit and listen to what was going on inside. The officer also viewed the contents of his storage locker.

Based on the information, police obtained a search warrant of the unit and turned up 1.7 kilograms of cocaine, 6.9 kilograms of marijuana and a few grams of crack cocaine. White was also carrying $400 in cash and a small amount of cocaine. They arrested White, then 37 years old, for drug trafficking and possession of property obtained by crime.

In obtaining the warrant, police did not tell the judge that the detective had gained entry into the locked building without permission. At trial, they said it was unnecessary because the officer had not done anything wrong by going inside.

The detective testified that he believed he was entitled to enter a multi-unit property as part of an investigation, but conceded he had sought permission to do so retroactively from the condo board.

In April 2013, Superior Court Justice Paul Lalonde concluded police had been wilfully blind or ignorant, and had shown bad faith. Lalonde threw out the evidence based on the covert entries, saying it was obtained in breach of White's constitutional rights.

He then acquitted White of the trafficking and property charges -- but convicted him of possession of the cocaine that he had on him.

In challenging the acquittal, the Crown argued White had no reasonable expectation of privacy in the common areas of his multi-unit building, saying it would be perverse to make such areas a "zone of protection for criminal activity" that would undermine their safety and quality of residents' lives.

The Appeal Court disagreed.

"There is nothing 'perverse' about providing a measure of privacy protection to the many Canadians who live in multi-unit dwellings," the Appeal Court said.

"They, no less than those who live in detached homes, are entitled to the protection against unreasonable search and seizure the charter provides."