A jury handed a stunning acquittal on murder and manslaughter charges to a homeless undocumented immigrant whose arrest in the killing of Kate Steinle on a San Francisco Bay pier intensified a national debate over sanctuary laws.

In returning its verdict Thursday afternoon on the sixth day of deliberations, the Superior Court jury also pronounced Jose Ines Garcia Zarate not guilty of assault with a firearm, finding credence in defense attorneys’ argument that the shot that ricocheted off the concrete ground before piercing Steinle’s heart was an accident, with the gun discharging after the defendant stumbled upon it on the waterfront on July 1, 2015.

Garcia Zarate, a 45-year-old Mexican citizen who was released from County Jail before the killing despite a federal request that he be held for his sixth deportation, was convicted of a single lesser charge of being a felon in possession of a gun. He faces a sentence of 16 months, two years or three years in state prison. Garcia Zarate, who has already served well over two years in jail and gets credit for that time, will be sentenced at a date not yet determined.

The verdict set off a flurry of reactions. Defense attorneys said the case had been overcharged, while U.S. Attorney General Jeff Sessions blamed the killing on San Francisco’s policy of refusing cooperation with immigration agents. Jim Steinle, who had been strolling on the pier with his daughter when she fell, told The Chronicle he was “saddened and shocked,” adding, “Justice was rendered, but it was not served.”

Garcia Zarate showed little emotion when the verdict was read, but hugged his attorneys. Public Defender Jeff Adachi, whose office represented Garcia Zarate, said his client was “extremely relieved.”

“He knew what was at stake — his life was at stake,” Adachi said. “I think he feels tremendous sympathy for Kate Steinle and her family — we do as well — but unfortunately these types of horrible, tragic accidents happen every day.”

President Trump, who has cited the case in his effort to build a border wall, said on Twitter, “A disgraceful verdict in the Kate Steinle case! No wonder the people of our Country are so angry with Illegal Immigration.”

Defense attorney Francisco Ugarte suggested a different lesson, saying, “From day one, this case was used as a means to foment hate, to foment division, to foment a program of mass deportation ... and I believe today is a vindication for the rights of immigrants.”

Jurors exited the city’s Hall of Justice quickly and declined to discuss their deliberations. “If I’m going to speak to anybody, I’m not going to do it today,” said one man, who declined to give his name. “I have to collect my thoughts.”

Garcia Zarate was charged from the beginning with murder, and prosecutors gave the jury the option of convicting him of first-degree murder, second-degree murder or involuntary manslaughter. Jurors rejected all three.

The defendant is not likely to be released again in the city. San Francisco officials have long said they will turn over undocumented immigrants to federal authorities if they obtain a warrant, and records show Garcia Zarate is being held on a U.S. Marshals Service warrant.

U.S. Immigration and Customs Enforcement “will work to take custody of Mr. Garcia Zarate and ultimately remove him from the country,” Tom Homan, the agency’s deputy director, said in a statement.

Steinle, 32, had been walking with her arm around her father on Pier 14 when she was struck in the back by a single bullet. The round had skipped off the concrete ground after being fired from a pistol that had been stolen, four days earlier, from the nearby parked car of a federal ranger.

Prosecutors told the jury that Garcia Zarate brought the gun to the pier that day to do harm, aimed it toward Steinle and pulled the trigger. Assistant District Attorney Diana Garcia spent much of the trial seeking to prove the pistol that killed Steinle couldn’t have fired without a firm pull of the trigger, while establishing that Garcia Zarate tossed the weapon into the bay before fleeing the scene.

Alex Bastian, a spokesman for the district attorney’s office, said Thursday that prosecutors had found sufficient evidence for the charges at every step of the case.

“The verdict that came in today was not the one we were hoping for, but I think it’s unequivocal that both sides gave it their all,” Bastian said. “This really is about the Steinle family. They’ve shown incredible resolve during this whole process, and our hearts go out to them.”

Defense lawyers said the shooting was an accident that happened when Garcia Zarate, who had a history of nonviolent drug crimes, found the gun wrapped in a T-shirt or cloth under his seat on the pier just seconds before it discharged in his hands. Lead attorney Matt Gonzalez said his client had never handled a gun and was scared by the noise, prompting him to fling the weapon into the bay, where a diver fished it out a day later.

Earlier Thursday, jurors paused their deliberations to ask if they could test the pistol’s trigger. Judge Samuel K. Feng said no.

During the monthlong trial, jurors watched video from Garcia Zarate’s four-hour police interrogation, in which he offered varying statements about his actions on the pier. At one point he said he had aimed at a “sea animal,” and at another point, he said the gun had been under a rag that lay on the ground near the waterfront, and that it fired when he stepped on it.

Gonzalez said it was clear in the video that Garcia Zarate — who has spent much of his adult life behind bars, was living on the street before the shooting, and has a second-grade education — did not fully understand what the officers were asking him through an officer’s Spanish translation.

The .40-caliber Sig Sauer pistol had been stolen from a U.S. Bureau of Land Management ranger’s car after he drove into the city and parked along the Embarcadero. No one has been arrested in the burglary, one of several cases in recent years in which Bay Area law enforcement officers lost guns to thieves and which have prompted legislators to push for tougher requirements for securing weapons.

Jurors had to ignore the political firestorm that hit San Francisco in the days following Steinle’s death. Proponents of stricter enforcement of immigration laws pointed to the killing as an example of the dangers of shielding people who are in the U.S. illegally, and Trump referred to the crime several times during his 2016 presidential campaign.

“My opponent wants sanctuary cities,” Trump said in his nomination acceptance speech at the Republican National Convention. “But where was the sanctuary for Kate Steinle?”

Before the shooting, Garcia Zarate had been on track for a sixth deportation after serving 46 months in prison for felony re-entry into the country. But his course changed when he was transferred from federal custody to San Francisco County Jail in March 2015 on an old warrant alleging he fled marijuana charges in 1995.

When city prosecutors discharged the case, the Sheriff’s Department released Garcia Zarate despite a federal request to hold him for deportation. Then-Sheriff Ross Mirkarimi cited the city’s sanctuary policies, which limit local cooperation with immigration enforcement and seek to encourage undocumented people to feel comfortable having a relationship with city agencies.

Anger over Garcia Zarate’s release contributed to Mirkarimi’s 2016 re-election defeat. But San Francisco remains committed to its sanctuary status, and Gov. Jerry Brown recently signed a bill to create a statewide sanctuary policy.

The San Francisco Board of Supervisors amended the city’s sanctuary policies after the shooting. But if a person with Garcia Zarate’s record before the Pier 14 shooting were in San Francisco jail today, and eligible for release, he would still be freed rather than turned over to immigration agents in the absence of a federal warrant.

The case continues to reverberate. The Trump administration has invoked the shooting in its effort, unsuccessful so far, to strip federal funds from cities and states that refuse to take part in immigration enforcement. The House of Representatives, meanwhile, passed “Kate’s Law,” which would increase prison sentences for immigrants who re-enter the U.S. after deportation.

After Thursday’s verdict, Sessions released a statement saying that San Francisco’s decision to “protect criminal aliens led to the preventable and heartbreaking death of Kate Steinle.”

Gonzalez punched back, reminding Trump, Sessions and Vice President Mike Pence of the ongoing investigation into collusion between the Trump campaign and the Russian government. The men, he said, “may soon avail themselves of the presumption of innocence and beyond-a-reasonable-doubt standard.”

San Francisco Chronicle staff writers Evan Sernoffsky and Bob Egelko contributed to this story.

Vivian Ho is a San Francisco Chronicle staff writer. Email: vho@sfchronicle.com Twitter: @VivianHo