A California appeals court Friday tossed out on a technicality the only conviction against the illegal immigrant who shot and killed a woman while he was free under San Francisco’s “Sanctuary City” policy in 2015.

Jose Inez Garcia-Zarate, who had been deported by the US five times, will remain jailed on related federal and immigration charges.

He now faces a retrial on the overturned conviction, which was for illegally possessing a firearm after the shooting, his lawyer, Tony Serra, told The Associated Press.

He had previously been acquitted of the woman’s murder.

Garcia-Zarate has claimed he merely found the gun on the city’s waterfront that day, wrapped in a T-shirt — and that it accidentally fired.

The bullet ricocheted off the ground before it hit 32-year-old Kate Steinle, who was walking with her father and a friend along the waterfront.

The appeals court overturned his conviction on Friday because the judge in the case did not tell the jury they could acquit Garcia-Zarate on the grounds that he only possessed the gun for a short amount of time.

The killing touched off an immigration debate and was used repeatedly by President Trump as a warning about so-called “sanctuary cities.”

Garcia-Zarate had been in jail before the shooting, but was released because of San Francisco’s sanctuary city policy that blocks local police from cooperating with federal immigration enforcement.

The district attorney will also have the option of retrying Garcia-Zarate on gun and homicide charges because of the reversal.

“That kind of error causes reversals all the time. Then the prosecution has the prerogative of going again,” his lawyer said.

With AP