PHOENIX — Someone visiting a home when police show up with a search warrant can have their purses and personal property examined, the Arizona Supreme Court ruled Wednesday.

In a precedent-setting ruling, the justices rejected arguments by attorneys for Alicia Gilstrap that her purse was off limits as she happened to be at the Kingman house and she was not named in the warrant. They said the fact that her purse was there and that it could contain what they were looking for — in this case, drugs — meant the search warrant extended to what they found in the house, regardless of ownership.

Justice Robert Bruinel, writing for the unanimous court, said there is a limit to that right of police to search.

He said if Gilstrap was actually holding the purse on her when police showed up, they could not have searched it because the purse would have been an extension of her. And she was not listed in the warrant at someone who could be searched.

Brutinel, however, said once Gilstrap put it down to go to take a shower, she no longer was in possession of the purse — even though it was in the bathroom — and it became fair game for police.

Sigmund Popko, a professor at the Sandra Day O’Connor College of Law at Arizona State University, said there’s an important lesson in Wednesday’s ruling for those who don’t want to risk having their possessions searched.

“Choose your friends wisely,” he said.

Gilstrap was arrested on three drug charges after police said they found baggies of marijuana, methamphetamines, baggies and a scale in her purse.

A trial judge refused her request to declare the search illegal and she was convicted.

Brutinel said the Fourth Amendment guarantees that people are free from unreasonable searches and seizures. And he said warrants must “particularly describe the place to be searched, and the persons or things to be seized.”

He said the U.S. Supreme Court has concluded that a valid search warrant authorizes the search of anything found on the premises that might contain the object of the search. But he said a warrant to search a premises does not authorize searching someone who is not named.

Brutinel said the law in some states is that police cannot search an object once they are put on notice that it belongs to someone who does not live there. Others have laws requiring a showing of some relationship between the item and the warrant.

He and his colleagues rejected both, saying the law in Arizona comes down to a simple question of possession. He said that’s far easier for police to understand and obey than any other approach.

“Searches often occur in harried, dangerous circumstances and officers may not be readily able to identify the relationships between person and the premises or to assess whether items might belong to someone not named in the warrant,” Brutinel wrote.

Gilstrap said if that is to be the test, she met it. She argued that while she was not physically holding the purse, she “constructively” possessed it because it was in the bathroom with her.

Brutinel acknowledged there is precedent for that — elsewhere. He noted the California Court of Appeals concluded that clothing someone removed while taking a shower was an extension of that person.

But the justices refused to apply that rule in Arizona.