A Mexican national who touched off a debate on illegal immigration when he fatally shot a woman on a San Francisco pier fired the gun on purpose, a prosecutor said Monday in her opening statement at his trial.

Deputy District Attorney Diana Garcia showed jurors the handgun that Jose Ines Garcia Zarate is accused of firing and said a ballistics expert will testify that the only way to fire it is to pull the trigger.

"It's a very reliable, high-quality gun," Garcia said. "It's one that won't go off on accident."

Garcia Zarate's lawyer, Matt Gonzalez, countered that his client did not know he had picked up a gun when he reached under a bench and found something wrapped in a T-shirt. The lawyer said the gun had no safety and operated on a hair-trigger motion.

"He did not know he was handling a firearm," Gonzalez said.

He added: "This gun is inherently dangerous in the hands of someone who isn't properly trained."

Gonzalez asked jurors if they believed prosecutors would have charged "a college student or Swedish tourist" with murder if they were the suspects instead of Garcia Zarate.

The shooting in 2015 touched off a political furor during last year's presidential race, with President Donald Trump citing the killing of 32-year-old Kate Steinle as a reason to toughen U.S. immigration policies.

The handgun belonged to a Bureau of Land Management ranger who reported that it had been stolen from his parked car in San Francisco a week before Steinle was shot.

Prosecutors called Steinle's father as their first witness.

Through tears, with a packed courtroom hanging on every word, Jim Steinle recounted the final moments of his daughter's life after she was shot.

He told the court that he and a family friend were visiting his daughter and they went for a walk on the popular waterfront.

The elder Steinle said he heard a loud "bang" and his daughter collapsed in his arms, saying "'help me, Dad.'"

Jim Steinle said her eyes were closed and she had trouble breathing.

"I couldn't figure out what was wrong," he said, choking back tears. "She didn't have any health problems."

He rolled her on her side and discovered a bullet hole with little blood. Paramedics arrived and she was later declared dead at a hospital.

Garcia Zarate, 54, has acknowledged shooting Steinle in the back. He has said he was handling the handgun when it accidentally fired.

Garcia Zarate is charged with second-degree murder, which could result in a sentence of 15 years to life in prison if he is convicted.

Garcia Zarate had been deported five times and was homeless in San Francisco when he shot Steinle. He had recently completed a prison sentence for illegal re-entry to the U.S. when he was transferred to the San Francisco County jail to face a 20-year-old marijuana charge.

Prosecutors dropped that charge, and the San Francisco sheriff released Zarate from jail despite a federal immigration request to detain him for at least two more days for deportation.

The sheriff's department said it was following the city's sanctuary policy of limited cooperation with federal immigration authorities.

Since being elected, Trump has threatened to withhold federal funding to so-called sanctuary cities such as San Francisco, several of which have filed lawsuits to prevent the move.

None of that is at issue during the trial, and the judge has barred mention of the politics of immigration and gun control during the proceedings.

Steinle's mother and brother also attended the opening of the trial, where lawyers for each side spoke for about 90 minutes. The trial is expected to last several weeks.