Most did not notice the slight figure dressed all in black on San Francisco’s Pier 14, but a few who did testified Tuesday about the man’s unusual behavior before and after the single shot rang out that killed Kate Steinle.

On the second day of the trial into the shooting that intensified a national debate around immigration enforcement and sanctuary policies, the prosecution sought to bolster its assertion that the defendant, Jose Ines Garcia Zarate, intentionally fired toward Steinle as she walked along the waterfront with her father on the evening of July 1, 2015.

The defense, which says Garcia Zarate found the gun wrapped in a T-shirt under a bench before it fired accidentally in his hands, questioned the reliability of the witnesses’ recollections.

A tourist, Michelle Lo, testified that she saw Garcia Zarate spinning in his seat and laughing to himself just before a bullet pierced Steinle in the back.

Later, Maria Moreno, an elementary school teacher who had been visiting San Francisco, told jurors she witnessed the aftermath of the shooting from her fifth-floor room in a nearby hotel, and saw Garcia Zarate hurrying away with a scowl on his face and his hands balled into fists in his pockets.

Neither witness could settle the main question in the Superior Court trial, which is whether the shooting was intentional or accidental, but prosecutors are seeking to build evidence establishing that Garcia Zarate acted with the implied malice, or intent, needed to convict him of second-degree murder.

Through a Cantonese interpreter, Lo testified she was visiting San Francisco from the East Coast when she and her sister brought their children to the pier. Just before the shooting, she said, she glanced briefly at Garcia Zarate as she walked by him.

Garcia Zarate was dressed in black, grinning and looking at everyone who passed him as he spun on a seat near the middle of the pier, Lo said. She said she noticed him because of his movements, and that she continued to the end of the walkway to take pictures of San Francisco Bay.

In cross-examination, Matt Gonzalez of the public defender’s office questioned Lo’s recollection, asking if she remembered telling officers after the shooting that she did not see the man’s face.

He asked why Lo did not initially tell officers she saw Garcia Zarate laughing and grinning, and suggested her identification of the defendant may have been influenced by seeing photos of him after his arrest.

“I saw him physically that day, and then I saw his photograph,” Lo said. “That is how I remember him.”

Gonzalez questioned the teacher, Moreno, about her description of Garcia Zarate’s hands balled into fists, and why that differed from photos she took of him. Moreno stood by her recollection, saying that while two photographs may show him with one hand out, she saw him with a scowl on his face.

Her roommate, Aryn Carpenter, who was with her in the hotel room, testified that she and Moreno zeroed in on the man because he appeared to be the only one leaving the pier as others rushed to help Steinle, though he walked slowly, almost casually.

Gonzalez is seeking to prove the shooting was an accident that occurred when his client stumbled upon the .40-caliber Sig Sauer.

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.

Because Garcia Zarate, a 45-year-old Mexican citizen, was in the country illegally, the case added fuel to the anti-immigration fervor that helped propel President Trump into the White House.

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 he was transferred from federal custody to 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, relying on the city’s sanctuary policies.

The case sparked a push against the policies, and the House of Representatives in June passed “Kate’s Law,” which would boost punishment for people who repeatedly enter the U.S. illegally.

San Francisco has stood by its sanctuary laws, with officials saying they benefit public safety by ensuring that immigrants, including witnesses to crimes, feel comfortable working with authorities. Gov. Jerry Brown this month signed a bill to create a statewide sanctuary policy.

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