SAN FRANCISCO -- A federal agent whose stolen handgun was used to kill a woman on a San Francisco pier testified Thursday that he was confident the weapon had been stored securely in his SUV while he and his family had dinner.

Bureau of Land Management ranger John Woychowski Jr. testified in the murder case that prompted a national debate about illegal immigration after the arrest of a Mexican national who had been deported five times.

Radio station KQED reported Woychowski said he put the semi-automatic handgun in a backpack hidden behind the reclined driver's seat of his personal SUV.

Get Breaking News Delivered to Your Inbox

"It was well-lit, metered parking with other pedestrians in the area," Woychowski testified. "I thought it would be pretty safe."

The vehicle was broken into and the gun used days later to kill Kate Steinle while she walked on the pier with her father and a family friend. The agent was not disciplined and was promoted five months later, court records show.

Burglaries of cars have plagued San Francisco for years.

The agent's testimony came in the fourth day of the trial of Jose Ines Garcia Zarate, who could face a sentence of 25-years-to-life in prison if convicted.

Garcia Zarate has said the shooting was an accident. He told police he found the gun wrapped in a T-shirt under a bench on the pier and it accidentally fired when he picked it up.

The bullet ricocheted before striking Steinle in the back.

Jurors on Wednesday were shown surveillance footage of the shooting taken from a fire station located about a quarter of a mile away.

The grainy, black-and-white footage shows a small figure dressed in black, identified by police as Garcia Zarate, sitting down on a chair on the Pier shortly after 6 p.m., according to police Officer Craig Dong, who collected and analyzed the video.

Garcia Zarate's attorney Matt Gonzalez told the jury Monday that the negligent storage of the gun started a chain of events that led to the accidental shooting of Steinle.

Gonzalez asked the agent if he thought he bore any responsibility for Steinle's death. But the judge upheld prosecutor Dianna Garcia's objection to the question and Woychowski didn't have to answer.

The trial is expected to last another three weeks.