The vote was a very close 5 to 4.
"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.
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."
Nearly 13,000 samples were tested for DNA last year at the Orange County crime lab. Authorities estimate that number could go up as much as 30 percent following the Supreme Court's ruling. It's a decision applauded by the Orange County Sheriff's Department.
"When you're booked for a serious crime or felony, now there will be fingerprints, photograph and a DNA sample," said Jim Amormino with the Orange County Sheriff's Department.
Nearly 30 states, including California, already take DNA samples after an arrest. The sheriff's departments in Los Angeles and Orange counties have been doing this for years.
Authorities say the Supreme Court ruling gives new hope to solving more cold cases, such as the Golden State Killer linked to 50 rapes and at least 10 murders. In 2001, DNA evidence connected a serial rapist whose crimes started in Northern California in 1976 with a serial killer who terrorized Southern California starting in 1979.
"In a case like that, we do have DNA, but many times when suspects feel the heat from law enforcement, they'll go to another state. Right now, if that state doesn't take DNA swabs, we may never have anything to compare it to," said Amormino.
Authorities say the ruling allows police in all states to collect DNA swabs from those arrested for serious crimes, such as rape or burglary. But the American Civil Liberties Union says the ruling goes too far, allowing police to search people who have never been convicted of any crime.
"The heart of the Fourth Amendment's protection is that before police can search for evidence they have to have some reason to believe that the person they're searching has evidence or was involved in a crime. This opinion creates a gaping exception for that," said Peter Bibring with ACLU of Southern California.
The Associated Press contributed to this report.