The San Francisco murder case that ignited a national debate over immigration policy went to trial Monday with attorneys sparring not over politics but the case’s central legal question — whether the killer of Kate Steinle on Pier 14 intended to fire in her direction or accidentally shot a gun he said he found under a bench.

A city prosecutor said in her opening statement that Jose Ines Garcia Zarate, 45, brought the stolen pistol to the waterfront location, pointed it toward Steinle and pulled the trigger on July 1, 2015.

The public defender representing the Mexican citizen said he found the gun in a T-shirt on the pier moments before the shooting, and that after he unwrapped the bundle the gun discharged a bullet that ricocheted off the concrete and struck Steinle in the back.

By the afternoon, the trial’s first witness introduced the Steinle family’s heartbreak into the courtroom. The victim’s father spoke of the confusion he felt as his daughter spoke her final words: “Help me, Dad.”

The trial in front of Superior Court Judge Samuel Feng opened to broad interest fueled by the political firestorm that followed it. Garcia Zarate, who was homeless and had a record of drug crimes, was wanted for deportation by federal agents when his San Francisco jailers set him free 2½ months before the shooting under the city’s sanctuary laws.

But the job of the jury sitting at the Hall of Justice is to put aside those politics. It is Garcia Zarate’s intentions on the day he killed Steinle that could mean the difference between a conviction for second-degree murder or manslaughter, or an acquittal.

The prosecutor, Diana Garcia, said the defendant was guilty of murder because he either aimed a loaded gun at Steinle directly or at a crowd of people — an act that implies malice, or an intent to kill.

“She’s dead because this man, known to the police as Juan Francisco Lopez Sanchez, pointed this gun in her direction and pulled the trigger,” Garcia said.

The gun had been stolen from a U.S. Bureau of Land Management ranger’s car four days before the shooting, when the off-duty ranger drove into the city and parked along the Embarcadero. No one has been arrested in the burglary.

Garcia said Garcia Zarate had been wearing many layers of clothing that could have hid the gun when he sat down at the pier.

“He knew he had a gun,” she said. “He meant to conceal it from people. He meant to shoot it at people. He meant to shoot it at people, and he shot Kate Steinle.”

In his opening statement, attorney Matt Gonzalez of the city Public Defender’s Office said the shooting was an accident, citing the bullet’s ricochet as evidence.

Gonzalez played jurors surveillance video from about an hour before the shooting that showed a group of people gathered around the bench where Garcia Zarate later sat. Gonzalez said it was possible that someone in the group had left the gun under the seat, and that Garcia Zarate had the misfortune of finding it.

The gun, a .40-caliber Sig Sauer, was known to have a hair trigger, and there have been cases of the gun discharging when the trigger was caught on a button or piece of clothing, Gonzalez asserted.

“The gun was pointed at the ground when it discharged the bullet,” he said. “Only a freakish ricochet altered the path of this bullet.”

Anticipating this argument, Garcia in her opening statement introduced the concept of a skip shot, in which a bullet hits a target after skipping off a surface. She said a ballistics expert will testify Garcia Zarate had the gun pointed at Steinle and the people around her, but that the shot bounced because of his seated position.

Garcia Zarate’s actions after the shooting reflected his state of mind, the prosecutor said. While others on the pier rushed to aid Steinle, she said, the defendant tossed the gun into San Francisco Bay and fled in the opposite direction. He was soon arrested.

Gonzalez said his client has a second-grade education. He played snippets of Garcia Zarate’s interviews with police, in which he repeatedly told frustrated officers, “I don’t, no remember.”

When he tossed the gun into the bay and left the scene, Gonzalez said, his client was scared by the noise the gun made and just wanted it to stop shooting.

“If it was a purposeful shooting, he would have fired more than a single time,” Gonzalez said.

The victim’s father, James Steinle, took the stand to describe the events leading to the shooting, saying he and a family friend had met his daughter in the city, where she lived, before going to lunch.

On Pier 14, the father and daughter strolled with their arms around each other. James Steinle, who became emotional at times, said he recalled a loud bang before he noticed his daughter had been wounded.

District Attorney George Gascón and Public Defender Jeff Adachi attended the opening statements, sitting on opposite sides of the aisle from each other, Gascón with members of the Steinle family and Adachi with the Mexican consul general in San Francisco and two women said to be relatives of Garcia Zarate.

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 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 this month 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 were in San Francisco jail today, and eligible for release, he would still be freed rather than turned over to immigration agents.

President Trump argued during his campaign that the case showed the need for his proposed wall along the Mexican border.

The Trump administration has since invoked Garcia Zarate and the slaying 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, like the shooter, re-enter the U.S. after deportation.

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

Twitter: @VivianHo