WASHINGTON - A sharply divided Supreme Court on Monday cleared the way for police to take a DNA swab from anyone they arrest for a serious crime, endorsing a practice now followed by more than half the states as well as the federal government.

The justices differed strikingly on how big a step that was.

"Taking and analyzing a cheek swab of the arrestee DNA is, like fingerprinting and photographing, a legitimate police booking procedure that is reasonable under the Fourth Amendment," Justice Anthony Kennedy wrote for the court's five-justice majority. The ruling backed a Maryland law allowing DNA swabbing of people arrested for serious crimes.

But the four dissenting justices said the court was allowing a major change in police powers, with conservative Justice Antonin Scalia predicting the limitation to "serious" crimes would not last.

"Make no mistake about it: Because of today's decision, your DNA can be taken and entered into a national database if you are ever arrested, rightly or wrongly, and for whatever reason," Scalia said in a sharp dissent which he read aloud in the courtroom. "This will solve some extra crimes, to be sure. But so would taking your DNA when you fly on an airplane — surely the TSA must know the `identity' of the flying public. For that matter, so would taking your children's DNA when they start public school."

Maryland Attorney General Doug Gansler agreed that there's nothing stopping his state from expanding DNA collection from those arrested for serious crimes to those arrested for lesser ones like shoplifting.

"I don't advocate expanding the crimes for which you take DNA, but the legal analysis would be the same," Gansler said. "The reason why Maryland chooses to only take DNA of violent criminals is that you're more likely to get a hit on a previous case. Shoplifters don't leave DNA behind, rapists do, and so you're much more likely to get the hit in a rape case."

Twenty-eight states and the federal government now take DNA swabs after arrests. But a Maryland court said it was illegal for that state to take Alonzo King's DNA without approval from a judge, ruling that King had "a sufficiently weighty and reasonable expectation of privacy against warrantless, suspicionless searches" under the Fourth Amendment to the Constitution.

The high court's decision reverses that ruling and reinstates King's rape conviction, which came after police took his DNA during an unrelated arrest.

Kennedy, who is often considered the court's swing vote, wrote the decision along with conservative-leaning Chief Justice John Roberts and Justices Samuel Alito and Clarence Thomas. They were joined by liberal-leaning Justice Stephen Breyer, while the dissenters were the conservative-leaning Scalia and liberal Justices Ruth Bader Ginsburg, Sonia Sotomayor and Elena Kagan.

Kennedy called collecting DNA useful for police in identifying individuals.

"The use of DNA for identification is no different than matching an arrestee's face to a wanted poster of a previously unidentified suspect, or matching tattoos to known gang symbols to reveal a criminal affiliation, or matching the arrestee's fingerprints to those recovered from a crime scene," Kennedy said. "DNA is another metric of identification used to connect the arrestee with his or her public persona, as reflected in records of his or her actions that are available to police."

But the American Civil Liberties Union said the court's ruling created "a gaping new exception to the Fourth Amendment."

"The Fourth Amendment has long been understood to mean that the police cannot search for evidence of a crime — and all nine justices agreed that DNA testing is a search — without individualized suspicion," said Steven R. Shapiro, the group's legal director. "Today's decision eliminates that crucial safeguard. At the same time, it's important to recognize that other state laws on DNA testing are even broader than Maryland's and may present issues that were not resolved by today's ruling."

Maryland's DNA collection law only allows police to take DNA from those arrested for serious offenses such as murder, rape, assault, burglary and other crimes of violence. In his ruling, Kennedy did not say whether the court's decision was limited to those crimes, but he did note that other states' DNA collection laws differ from Maryland's.

Scalia saw that as a crucial flaw. "If you believe that a DNA search will identify someone arrested for bank robbery, you must believe that it will identify someone arrested for running a red light," he said.

Scott Berkowitz, president and founder of the Rape, Abuse and Incest National Network, cheered the decision and called DNA collection "a detective's most valuable tool in solving rape cases."