The last lawsuit by the parents of Kate Steinle — against the U.S. government for employing a ranger who left the fatal handgun unlocked in a car on a downtown San Francisco street — was dismissed by a federal magistrate.

Ranger John Woychowski, and by implication the U.S. Bureau of Land Management that employed him, may have been negligent by leaving the handgun unlocked in a backpack on the passenger side of his private sport utility vehicle, vulnerable to a thief who smashed the vehicle’s windows one night in June 2015, said Chief U.S. Magistrate Joseph Spero.

But it was 3½ days later, on July 1, that Steinle, 32, was fatally wounded by a bullet from the gun that had bounced off the pavement and struck her as she was walking along Pier 14 with her father. Too much time had passed, and too many events had intervened, to make any negligence by the government a cause of her death, Spero said last week.

The gun wound up in the hands of Jose Inez Garcia Zarate, an undocumented immigrant. He denied intentionally shooting it and said he had found it wrapped in a towel and immediately dropped it as it went off.

A San Francisco jury acquitted Garcia Zarate of murder and assault charges and convicted him only of being a felon in possession of a gun. A state appeals court overturned that conviction and said the jury should have been allowed to decide whether he held only “momentary possession” of the weapon, which would not have been a crime.

Local prosecutors then dropped that charge. But Garcia Zarate, 46, who had been behind bars since the shooting, remains in custody facing federal charges of being a felon and an undocumented immigrant in possession of a gun and ammunition.

Garcia Zarate had been deported five times to his native Mexico and had just spent 46 months in federal prison for illegal re-entry when federal officials turned him over to San Francisco in March 2015 to face an old marijuana charge. City prosecutors dropped that charge, and then-Sheriff Ross Mirkarimi’s office released Garcia Zarate without notifying immigration agents, who had requested detention until they could pick him up. Mirkarimi cited San Francisco’s sanctuary policy, which allowed local officials to disregard such requests.

Steinle’s parents, Jim Steinle and Elizabeth Sullivan, sued both the city and the federal government for damages. Spero dismissed their claims against San Francisco in 2017, saying there had been no evidence that Garcia Zarate was dangerous and federal law did not require the city to inform the government of his release. The magistrate allowed the parents to gather more evidence in their suit against the government, but dismissed that case last Monday.

Carelessness that leads to a theft can sometimes be grounds for a lawsuit, Spero said — for example, the owner of a truck or a bulldozer who leaves the key in the ignition can be sued for the havoc caused by thieves. But in this case, he said, there is no evidence that Garcia Zarate stole the gun and, other than the identity of the weapon, “no evidence that the shooting was in any way connected with the theft.”

Alison Cordova, a lawyer for Steinle’s parents, said they would appeal the ruling. Woychowski could have stored the gun in a locked glove compartment or the trunk, she said, and “without the ranger’s carelessness, Kate would be alive.”

Bob Egelko is a San Francisco Chronicle staff writer. Email: begelko@sfchronicle.com Twitter: @BobEgelko