SAN FRANCISCO (AP) — San Francisco cannot be held liable for a slaying by a man who was in the country illegally and had been released by sheriff’s officials despite a request by immigration officials to keep him behind bars, a federal judge said.

U.S. Magistrate Judge Joseph Spero dismissed wrongful death claims filed by the family of 32-year-old Kathryn Steinle against the city and Sheriff Ross Mirkarimi. The judge, however, allowed a negligence claim against the federal government to move forward.

Steinle’s shooting death thrust San Francisco into the national debate over immigration

The man charged with murder in the July 2015 slaying, Juan Francisco Lopez-Sanchez, was a repeat drug offender who was transferred to the city jail to face a marijuana sales charge after he completed a federal prison sentence for illegally reentering the country. The district attorney dropped charges, and the sheriff’s department released Lopez-Sanchez three months before Steinle’s death, ignoring a request by U.S. Immigration and Customs Enforcement to keep him behind bars.

San Francisco’s so-called “sanctuary policy” bars city employees from cooperating with federal immigration officials in deportation efforts.

Mirkarimi cited the law in a 2015 memo to deputies that prohibited them from providing certain information to federal immigration authorities, including the date an inmate is released, according to Spero’s ruling. In their lawsuit, Steinle’s family cited a statement by immigration authorities that Lopez-Sanchez would have been deported and Steinle’s death prevented if sheriff’s officials had notified them about his pending release.

Spero said in his ruling on Friday that the sheriff did not violate state or federal law by prohibiting his deputies from telling immigration officials when an inmate is released.

Frank Pitre, an attorney for the Steinle family, said he was evaluating the best course forward.

Spero allowed a claim in the lawsuit alleging that a U.S. Bureau of Land Management ranger negligently left the gun used in Steinle’s slaying loaded inside a vehicle in San Francisco, and it was stolen.

Lopez-Sanchez says he found the gun and it fired when he picked it up, striking Steinle in the back. He has pleaded not guilty to a second-degree murder charge.

He is due to go on trial in San Francisco Superior Court next month.

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