A California state appeals court Friday overturned the lone conviction against an undocumented immigrant who shot and killed Kate Steinle on the San Francisco waterfront in 2015, a case that drew national attention and became a flashpoint in the debate over illegal immigration.

Jose Inez Garcia-Zarate, who was in the U.S. illegally and had been deported to his native Mexico five times, was acquitted in November 2017 of first- and second-degree murder, involuntary manslaughter, and assault with a semi-automatic weapon. He was convicted of one count of being a felon in possession of a firearm.

On Friday, the 1st District Court of Appeal in San Francisco overturned that conviction, saying the judge failed to give the jury the option of acquitting Garcia-Zarate on the theory he possessed the weapon for only a moment.

Prosecutors argued that the jury instruction lapse was harmless because Garcia-Zarate admitted firing the gun and experts said he couldn’t do so without pulling the trigger. The court disagreed, saying the jury’s verdict showed they rejected the prosecution theory that the shooting was intentional or even negligent and they had asked the judge to define possession and whether there was a time requirement for possession.

“These questions go to the heart of the momentary possession defense,” Justice Sandra Margulies wrote in the 3-0 decision. “The fact the jury asked whether there was a time requirement for possession suggests jurors were wrestling with how long [the] defendant had the gun.”

Garcia-Zarate remained in custody and was facing federal charges of gun possession and being in the country illegally. His attorney, Tony Serra, told The Associated Press that trial is scheduled to begin Jan. 13 and added that the appeals court reversal will give prosecutors the option to re-try Garcia-Zarate.

“That kind of error causes reversals all the time. Then the prosecution has the prerogative of going again,” Serra said. “The state case is a heavier case because it’s a homicide and a gun. … It’s going to be a big potential decision on what they’re going to do.”

The San Francisco district attorney’s office was weighing its options, spokesman Alex Bastian said.

Steinle, 32, died July 1, 2015, after she was struck by a bullet while walking with her father and a family friend. Garcia-Zarate claimed he unwittingly picked up the gun, which was wrapped in a T-shirt, and it fired accidentally.

The gun belonged to a federal Bureau of Land Management ranger and had been stolen from his parked car a week earlier.

Earlier this year, the 9th Circuit Court of Appeals upheld a lower court decision to dismiss a wrongful death lawsuit filed by Steinle’s parents against San Francisco. The lawsuit maintained that the city’s so-called sanctuary policy and San Francisco County Sheriff Ross Mirkarimi bore responsibility for Steinle’s death.

Three months before the killing, Garcia-Zarate was released from custody after a drug case against him was dropped. The sheriff’s office, which had ended contact between jail employees and immigration officials, ignored a request by federal authorities to hold Garcia-Zarate until they could assume custody and did not inform them that he was being released.

The case against Garcia-Zarate was a regular talking point in Donald Trump’s 2016 presidential stump speeches.

“Kate Steinle was tragically killed because San Francisco proudly proclaims itself a sanctuary city,” U.S. Citizenship and Immigration Services (USCIS) Acting Director Ken Cuccinelli tweeted Friday night. “How many more innocents will die b4 [before] sanctuary cities stop harboring violent criminals? This defies common sense, public safety, & human decency. #NoJustice.”

Fox News’ Elizabeth Zwirz and Elizabeth Llorente contributed to this report, along with The Associated Press.