In a unanimous decision Wednesday, the Supreme Court ruled that police cannot search cellphones and smartphones without obtaining a warrant first.

The Supreme Court justices were ruling on cases from California and Massachusetts. The justices agreed that both the right to privacy and the need to investigate crimes were important; however, ultimately, they agreed that the right for privacy would prevail in their ruling.

"We cannot deny that our decision today will have an impact on the ability of law enforcement to combat crime," Chief Justice John Roberts wrote for the court. "Privacy comes at a cost." 

Along with the ruling, the court struck down an intensive smartphone search in California. That case had been upheld by the California Court of Appeals. The other case that was struck down was a search of an old flip phone in Massachusetts. A federal judge had already thrown the case out.

As a result of the ruling, police won't be able to look into suspect cell phones without first obtaining a warrant. Currently, police can seize all items they find on a suspect and save them as evidence.

The justices said that due to the capabilities of modern cell phones, privacy concerns are greater than other types of evidence. The justices reserved the police right to claim "exigent circumstances."

Recent decisions by the Supreme Court have led to the capability for police officers to swab suspect's cheeks for DNA and store them into a database for unsolved crimes. Another decision allows strip searches of prisoners without reasonable suspicion.

Other decisions have been less friendly to law enforcement. Justices ruled that police need a warrant to attach a GPS device to a suspect's car. They also decided that a warrant is needed to obtain a blood sample for a suspected drunken driver who refuses a breathalyzer test. Finally, they ruled a warrant is needed before bringing a drug-sniffing dog up to the door of a suspect's house.

The two cellphone cases may be a preview of what's to come in high courts. The National Security Agency's phone and computer surveillance has been under controversy, and recently two federal district courts delivered two separate opinions on it.

Although the two cellphone cases were different crimes, they both involved police searching cellphones without obtaining a warrant.

In the California case, David Riley was pulled over for having expired tags. Guns were found under the hood of the car. Police also found incriminating photos and videos on his cell phone. He was convicted on gang-related weapons offenses. That conviction was upheld by a California Court. The Supreme Court justices overturned that conviction.

In the Massachussets case, Brima Wurie's drug charges were thrown out. Police targeted his old flip phone records to find drugs and weapons stored at his home.

Justices were asked to outline clear and cut rules for police to follow regarding privacy and fourth amendment rights, and that's likely why they made Wednesday's ruling.

Nine out of 10 adults own cellphones, more than half of those are smartphones. Eight of 10 adults use their phones to send text messages and more than half of adults use their phones to send emails, download applications and access the Internet.

With 12.2 million arrests made in 2012, not including traffic violations, it was important to get a ruling on cell phone searches.

The Supreme Court said: "Our answer to the question of what police must do before searching a cell phone seized incident to an arrest is accordingly simple -- get a warrant."