MARYLAND’S HIGHEST COURT last month barred police from collecting DNA samples upon arrest from suspects charged with violent crimes and burglaries. The decision deals a blow not just to public safety but also to common sense. It should be appealed, and overturned, as quickly as possible.

In Maryland, as in about half the states, it has been routine practice since 2009 for law enforcement officers to take DNA samples from individuals charged with certain serious crimes. Collecting the samples involves swabbing the inside of a cheek — an easy, quick and painless procedure, no more invasive than fingerprinting. In addition to its utility in identifying suspects, collecting DNA from pretrial detainees has helped to close cold cases, including some serious ones.

Nonetheless, in a 5 to 2 decision, the state Court of Appeals ruled that suspects enjoy, along with the presumption of innocence, an expectation of privacy — including from DNA swabs — that outweighs the government’s interest in fighting crime. The court had previously given the green light to taking DNA samples from violent criminals following conviction.

It’s a bizarre decision, to say the least. In many jurisdictions, and with explicit Supreme Court sanction, suspects are frisked, handcuffed and even strip-searched upon arrest. They are routinely fingerprinted, and in jail they can be observed, by uniformed officers or by other inmates, sleeping, eating or on the toilet. But according to the Maryland court, a five-second cheek swab constitutes an unreasonable search and an unwarranted intrusion into a suspect’s reasonable expectation of privacy. That seems a stretch, to say the least.

In fact, the collection of DNA samples — a technology that’s been forensically useful for a quarter century — is nothing more than an updated means of accurately identifying arrestees. As with fingerprints or even blood drawn from suspects — which the Supreme Court has explicitly permitted — DNA swabs can help police to implicate or exonerate a suspect in a crime, past or present.

The Maryland court frets that DNA contains a treasure trove of genetic information that a suspect should not be compelled to reveal. But state law forbids authorities from using DNA for purposes beyond identification. And, as Judge Mary Ellen Barbera pointed out in her dissenting opinion, the procedure by which DNA samples from suspects are tested does not yield any intimate genetic information.

The effect of the court’s decision will probably be to void the conviction of Alonzo Jay King Jr. for a 2003 rape. Mr. King’s conviction was based on a DNA sample taken six years after the fact, when he was arrested in an unrelated assault case in 2009. The appeals court says that, in most cases where DNA is needed for conviction, police will have other evidence establishing probable cause for a search warrant to do the swab. “Unfortunately,” the court adds, somewhat sheepishly, “that does not seem likely” in Mr. King’s case.

Unfortunately, indeed.