HARTFORD, Conn. — The state Supreme Court has ruled that police officers in Connecticut violated a man’s constitutional rights by illegally searching him when they patted him down in a parking lot and found heroin.

The court issued a 5-2 decision Tuesday saying the Bridgeport officers had no reason to believe Michael Edmonds was doing anything illegal in the parking lot in January 2011. Edmonds later pleaded no contest to a drug charge and failing to appear and was sentenced to four years in prison.

Justices ordered that the drug evidence be suppressed in the lower court.

Two of the officers who searched Edmonds were sentenced last year to three months in prison for beating a suspect in a separate case. Elson Morales and Joseph Lawlor resigned from the force.