Maryland's highest court on Tuesday blocked police in most cases from collecting DNA samples when they arrest suspects in violent crimes and burglaries, dealing a blow to one of Gov. Martin O'Malley's signature initiatives.

The Court of Appeals ruled 5-2 that the state violated Alonzo Jay King Jr.'s constitutional rights by using DNA evidence taken from him after a 2009 assault arrest. That sample led to his conviction in a six-year-old rape case, but the court said it also ran afoul of protections against unreasonable searches without a warrant. The judges ordered that King's rape case be sent back to Wicomico County Circuit Court for a new trial.

O'Malley and law enforcement officials said the decision would set back the state's crime-fighting efforts, but civil liberties advocates and defense attorneys called it a victory for individual freedoms. The state can still collect DNA after convictions, and experts said the court's ruling is unlikely to reverse other convictions.