In a controversial 5-4 decision the Supreme Court ruled that police are allowed to take a DNA swab of people arrested for a serious crime, reports The New York Times.

In the majority opinion Justice Anthony Kennedy wrote that taking a DNA sample from a person arrested and charged but not yet convicted of a serious crime is not a violation of the Fourth Amendment barring unreasonable search and seizure.

"When officers make an arrest supported by probable cause to hold for a serious offense and they bring the suspect back to the station to be detained in custody," Kennedy wrote. "taking and analyzing a cheek swab of the arrestee's DNA is, like fingerprinting and photographing, a legitimate police booking procedure that is reasonable under the Fourth Amendment."

Joining Kennedy in the majority were Chief Justice John Roberts, Justices Clarence Thomas, Justice Stephen Breyer and Samuel Alito.

In a rare move Justice Antonin Scalia summarized his dissention to the court, an act that symbolizes a very profound disagreement with the decision, according to The New York Times.

"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 wrote.

Joining Scalia in dissent were Justices Sonia Sotomayor, Ruth Bader Ginsburg, and Elena Kagan.

The case revolved around a Maryland man, Alonzo King, who was arrested for assault in 2009. After taking a DNA swab police were able to connect King to a rape that had occurred six years earlier. Alonzo was convicted of the rape and sentenced to life in prison. The conviction was overturned when the Maryland Court of appeals ruled that the DNA swab was a violation of King's Fourth Amendment rights, according to NBC News.

In the majority opinion the court took care to point out that a DNA swab does not require surgical intrusion in the way that giving a blood sample does, a key reason that the court considers the swab to not be "unreasonable," according to NBC News.

Jim Harper, director of information policy studies at the Cato Institute, told MSNBC that police are not using the DNA samples in the way that Kennedy defined in the decision.

"Justice Kennedy says that you've got to get someone's identification for booking purposes, but that's not what's happening here," Harper said. "They're collecting DNA to investigate a person for other crimes that happened elsewhere, for which they have no suspicion."

In his dissent Scalia stated that the decision will help solve more crimes but only by violating people's rights.

"I doubt that the proud men who wrote the charter of our liberties would have been so eager to open their mouths for royal inspection," Scalia wrote in an allusion to the cheek swab used for collecting DNA samples.