(Click here if you are unable to view this video or photo gallery on your mobile device)

SAN FRANCISCO — The undocumented immigrant who was acquitted of murdering Pleasanton native Kate Steinle was sentenced Friday to three years in prison on a gun possession charge — but will not spend any more time in state custody because of credit for time served.

Jose Ines Garcia Zarate will now be handed over to federal authorities to be prosecuted on gun charges.

After a four-week trial that drew national attention, a jury in November acquitted the Mexican national of murder, involuntary manslaughter and assault with a semiautomatic firearm in the July 2015 shooting of Steinle on San Francisco’s Pier 14. But jurors convicted him of being a felon in possession of a firearm.

Judge Samuel Feng sentenced Garcia Zarate, who has already spent two and a half years in jail waiting for his trial, to time served on the possession conviction. Feng on Friday also denied a motion by Garcia Zarate’s defense lawyers to throw out the conviction.

The defense attorneys have argued that the jury received improper instructions about the charge. But the prosecution argued that no mistake had been made, and Feng agreed. The defense, however, plans to appeal Feng’s ruling, public defender Matt Gonzalez told reporters.

The high-profile case against Garcia Zarate sparked a national political firestorm over immigration policy. In 2015, then-presidential candidate Donald Trump and others blamed San Francisco’s “sanctuary city” policy for Steinle’s death. Garcia Zarate, 45, had been deported five times but was released from a San Francisco jail instead of being sent back to his native Mexico.

Early next week, Garcia Zarate will be arraigned in federal court in Oakland, where he faces similar charges of being a convicted felon and an illegal immigrant in possession of a firearm.

Garcia Zarate will be defended in federal court by J. Tony Serra, the flamboyant attorney who is also representing Ghost Ship manager Derick Almena in a criminal case stemming from the deaths of 36 people in a 2016 fire at the converted Oakland art space.

While both sides in state court assiduously avoided discussing politics in the courtroom — instead focusing on the physical evidence surrounding the shooting — Serra told reporters Friday that he’ll take a different stance in federal court. He said he plans to argue that the federal case should be dismissed for vindictive prosecution by the Trump administration.

“A vote for guilty in the federal case is a vote for Trump,” Serra said, adding that Garcia Zarate is “being made a martyr to the racist perspective of Trump.”

A spokesperson for the San Francisco U.S. Attorney’s Office did not immediately respond to a request for comment.

Garcia Zarate’s defense attorneys have argued that the shooting was an accident, suggesting that he found the gun on the pier and that it accidentally discharged when he touched it, with the bullet ricocheting 78 feet before hitting the 32-year-old Steinle. Garcia Zarate threw the gun into the water after it fired.

In their motion for a new trial on the state gun possession charge, defense lawyers had asked Feng to instruct the jury about “momentary possession,” a defense to a possession charge when a defendant only briefly holds an illicit object like a gun or drugs while disposing of it. But Feng did not tell the jury about that part of the law, according to the defense motion.

A momentary possession defense requires that the defendant not throw away a gun in order to prevent police from retrieving it. Garcia Zarate’s lawyers claimed that he was tossing it in the water to stop it from shooting, while the prosecution argued that he was getting rid of it to avoid being caught.

While the conviction didn’t have much practical impact on Garcia Zarate’s prison sentence, if it had been thrown out it might have provided him a stronger defense in fighting the similar charge in federal court. The fact that Garcia Zarate was already convicted by a jury in state court is “going to be in the front lobe of every (federal) juror, and it’s a challenge for me,” Serra acknowledged.

Meanwhile, the lawyers for Steinle’s family have turned their attention to a pair of lawsuits that describe the woman’s death as a failure on multiple fronts: In addition to San Francisco and its sheriff, they blame federal immigration agents who failed to issue a warrant for Garcia Zarate’s deportation and the federal agency that owned the handgun that killed Steinle after it was stolen from an agent’s car.

“Kate’s fate was sealed when a U.S. Department of the Interior, Bureau of Land Management Ranger failed to properly secure and/or store a government-issued firearm while it was left in an unoccupied vehicle in a high auto-theft neighborhood,” the Steinles’ lawsuit states.

A federal judge has dismissed the family’s case against U.S. Immigration and Customs Enforcement, San Francisco and then-Sheriff Ross Mirkarimi, but ruled that the case against the Bureau of Land Management could proceed because its employee’s negligence contributed to Steinle’s death.

The family’s attorneys will head to court this month in the hopes of securing a date for the trial against the BLM. They’re also appealing the judge’s ruling in the case against San Francisco and Mirkarimi.

The Washington Post contributed to this report.