A California state appeals court on Friday threw out the sole conviction against an immigrant who fatally shot a young woman on the San Francisco waterfront in 2015.

Jose Inez Garcia-Zarate was acquitted of murder in the killing of Kate Steinle, who was walking on a pier with her father when she was struck by a bullet in the back in July 2015.

He was convicted of a single charge of being a felon in possession of a gun.

The case against Garcia-Zarate, who was in the country illegally and had been deported five times, touched off a fierce immigration debate that was a fixture in Donald Trump's stump speeches in his 2016 presidential campaign.

Jose Ines Garcia Zarate (left), an illegal immigrant who had been deported five times, was found not guilty of murder in the 2015 shooting death of Kate Steinle, 32 (right)

Garcia-Zarate admitted to picking up the gun that fired the fatal shot, but said it was accidental

The 1st District Court of Appeal overturned the gun conviction because the judge failed to give the jury the option of acquitting Garcia-Zarate on the theory he only possessed the weapon for a moment.

Garcia-Zarate said he unwittingly picked up the gun wrapped in a T-shirt, and it fired accidentally.

The bullet ricocheted off a concrete walkway and struck Steinle, who was with her dad and a family friend.

At the time, Garcia-Zarate had recently been released from the county jail while facing deportation proceedings.

He was released under San Francisco's so-called sanctuary city policy that barred local law enforcement officials from cooperating with most federal immigration investigations.

Steinle was walking on the pier with her dad and a family friend when she was fatally shot

Above, a memorial near the scene of the shooting. Garcia-Zarate said he unwittingly picked up the gun wrapped in a T-shirt, and it fired accidentally

Tony Serra, the attorney who is representing Garcia-Zarate on federal charges of gun possession and being in the country illegally, said his client is in custody and faces a January 13 trial.

He said the state reversal means the district attorney will have the option of re-trying Garcia-Zarate on those charges.

'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 did not immediately respond to a request for comment from DailyMail.com.