This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

SAN FRANCISCO — The man accused of killing a San Francisco woman in what appeared to authorities to be a random shooting told KGO that he he did it, but that it was an accident.

“Did you shoot Kate Steinle, the lady who was down at Pier 14?” the station’s reporter, Cornell Barnard, asked Juan Francisco Lopez-Sanchez in a jailhouse interview.

“Yes,” he answered, according to a transcript of the interview posted on the station’s website.

But he said the weapon — which he said he found laying on the ground wrapped in a T-shirt — went off by accident when he picked it up, according to KGO.

“Then suddenly I heard that boom boom, three times,” Lopez-Sanchez said, according to the station’s transcript.

Steinle was shot Wednesday while walking with her father on Pier 14, a popular walking spot on the city’s waterfront. She died on the way to the hospital.

The shooting, tragic enough on its own, has inflamed the national debate over immigration reform after it was revealed Lopez-Sanchez is an undocumented immigrant with a felony record who had been deported to Mexico five times.

Lopez-Sanchez reportedly told KGO that he came to San Francisco to look for work because he knew he would not be hounded by officials over his immigration status.

He was turned over to San Francisco authorities and ultimately released after completing a federal prison sentence in March.

U.S. Immigrations and Custom Enforcement said San Francisco wanted Lopez-Sanchez on a drug warrant, so they handed him over with a request to let them know if he was to be released.

Despite that request, San Francisco authorities let him go on August 15 after the drug charges were dropped.

Freya Horne, chief legal counsel to the San Francisco County Sheriff, said city officials believe such requests violate Fourth Amendment rights against unreasonable searches and seizures.

San Francisco is one of about 70 jurisdictions around the country that have policies limiting police involvement in immigration matters, according to the Center for Immigration Policy.

According to KRON, San Francisco’s policy on undocumented immigrants says that police “shall not detain an individual on the basis of a civil immigration detainer after that individual becomes eligible for release from custody.”

Critics of such policies say they allow dangerous criminals to remain living in the United States.

“This woman would be alive today if they did not have this stupid sanctuary law in that crazy city of San Francisco,” law enforcement analyst Harry Houck said.

But Ana Maria Salazar, a former deputy secretary of state and policy adviser in the Clinton administration, said such policies don’t make for more violence.

“All that data shows that migrants who have documents or who are undocumented who come to the United States have lower crime rates,” she said. “You cannot say that it was this policy per se that resulted in the death of this woman.”

The incident is also playing out in the presidential campaign. Republican contender Donald Trump has blamed immigration policy for Steinle’s death. Another Republican, Jeb Bush, agreed, saying such policies encourage crimes like Steinle’s death.