ASHLAND, VA - OCTOBER 20: A police officer lifts police tape while speaking on his radio at the scene of a suspected sniper shooting in the parking lot of a Ponderosa Restaurant October 20, 2002 in Ashland, Virginia. The 37-year-old male victim was rushed to a nearby hospital and underwent a three-hour surgery. (Photo by Mario Tama/Getty Images) (Mario Tama/Getty Images)

WASHINGTON (AP) — The Supreme Court ruled Tuesday that police may search a home without a warrant when two occupants disagree about allowing officers to enter, and the resident who refuses access is then arrested.

The justices declined to extend an earlier ruling denying entry to police when the occupants disagree and both are present.

Justice Samuel Alito wrote the court’s 6-3 decision holding that an occupant may not object to a search when he is not at home.

“We therefore hold that an occupant who is absent due to a lawful detention or arrest stands in the same shoes as an occupant who is absent for any other reason,” Alito said.

Police found a shotgun, ammunition and a knife when they searched the Los Angeles apartment that Walter Fernandez shared with his girlfriend, Roxanne Rojas.

Fernandez told police they could not enter. But shortly after his arrest, officers returned to the apartment and persuaded Rojas to let them in.

Fernandez is serving a 14-year prison term on robbery and guns charges.

Justice Ruth Bader Ginsburg wrote in dissent that “Fernandez’s objection to the search did not become null upon his arrest and removal from the scene.”

The court ruled 5-3 in 2006 that when two occupants who disagree about letting the police in are present, the objecting occupant prevails.

Ginsburg, joined by Justices Elena Kagan and Sonia Sotomayor, also took issue with the notion that ruling for Fernandez would harm women who are victims of domestic violence.

Ginsburg said that police are justified in the immediate removal of the abuser from the premises. That, she said, is what happened in this case. But that shouldn’t trump the need for a warrant to overcome Fernandez’s objection to the search of his home.

When Rojas first answered the door for police, she was crying and holding her 2-month-old baby. She had a fresh bump on her nose, and blood on her hands and shirt. She said she had been in a fight.

At that point Fernandez appeared and ordered the police to get out, telling them he knew his constitutional rights. The police believed the couple had just been in a fight and removed Fernandez from the apartment in handcuffs. An officer noticed a tattoo on Fernandez’ shaved head that matched the description of a robbery suspect. Fernandez soon was arrested.

California maintained in its argument at the court that police had enough evidence at that point to get a warrant. But they said one was unnecessary because Rojas had the authority to let them in, despite Fernandez’s earlier objection.

The court agreed with that proposition Tuesday.

The case is Fernandez v. California, 12-7822.

(© Copyright 2014 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)