One by one, five police officers took the witness stand at the Skokie courthouse late last month for what would typically be a routine hearing on whether evidence in a drug case was properly obtained.

But in a “Perry Mason” moment rarely seen inside an actual courtroom, the inquiry took a surprising turn when the suspect’s lawyer played a police video that contradicted the sworn testimony of the five officers — three from Chicago and two from Glenview, a furious judge found.

Cook County Circuit Judge Catherine Haberkorn suppressed the search and arrest, leading prosecutors to quickly dismiss the felony charges. All five officers were later stripped of their police powers and put on desk duty pending internal investigations.