WASHINGTON — The Supreme Court set the stage for an important Fourth Amendment ruling Friday, saying it will decide this term whether police may inspect a suspect’s cellphone without a search warrant when they make an arrest.

Courts in California and Massachusetts have split on the issue, and the justices agreed to hear cases from both states. In each case, criminal defendants were convicted and sentenced to lengthy prison terms, at least in part on the strength of evidence obtained by warrantless searches of their cellphones.

When police officers arrest a motorist, they are usually free to check around the car for guns, drugs or other items, including papers or notebooks. Citing this principle, some judges have said officers may also look through a cellphone to see where calls were made.

But other judges have said cellphones can hold a wealth of personal information, such as photos, contacts, emails and texts, that should be protected as private, at least until an officer obtains a search warrant.

    Most Read Stories

The court will hear an appeal from David Riley, a San Diego man who was stopped by the police, initially for having expired registration tags. A subsequent search of his cellphone tied him to a gang shooting. The California Supreme Court, in a 5-2 decision, upheld the search of cellphones in a related case.

The court will also hear the Justice Department’s appeal of a ruling that rejected the search of a cellphone taken from an alleged drug dealer in a Boston case.

In that case, a federal appeals court said the warrantless, but limited, search of an older flip phone violated the Fourth Amendment. After arresting Brima Wurie on suspicion of selling crack, police eventually examined the call log on his flip phone and used the information to determine where he lived.

When they searched his home, armed with a warrant, they found crack, marijuana, a gun and ammunition. The evidence was enough to produce a conviction and a prison term of more than 20 years.

Both cases will be argued in April.

Material from The Associated Press is included in this report.