WASHINGTON (AP) – The Supreme Court has limited the power of police to detain people who are not at home when their residence is to be searched.

By a 6-3 vote Tuesday, the justices sided with a Long Island, N.Y., man who was picked up about three-quarters of a mile away from his apartment as police searched it for a gun.

Justice Anthony Kennedy said in his opinion for the court’s majority that the authority of police to detain people found at home during a search authorized by a warrant is limited to the immediate vicinity of the premises. He said that concern for officer safety diminishes the farther away from the home the detention occurs.