SAN FRANCISCO (CBS SF) — The Mayor of San Francisco is calling for an investigation of how suspected killer Francisco Sanchez was set free under the city’s immigrant sanctuary law.

Mayor Ed Lee issued a statement Monday saying that city policy was never intended to protect “repeat, serious and violent felons.” He asked for federal and local agencies to quickly review what happened.

But under an expansion of that law signed by Lee, only violent felons, or those with pending charges, have to be turned over to federal immigration officials.

Sanchez, 45, had seven felony convictions, but none recent and none violent when he was released by San Francisco authorities despite an immigration hold on the Mexican national who had been deported five times before.

VIDEO: SF Archdiocese Leads Vigil For Woman Fatally Shot At Pier 14

In several jailhouse interviews, he admits he accidentally shot and killed 32-year-old Kathryn Steinle near Pier 14 last Wednesday. He also confirmed that he came to the city because of its status as a sanctuary.

Legal analyst Stephen Farkas said Steinle appears to be an innocent victim of a tragic, bureaucratic bungle.

“What needs to be done here is better communication between the federal government and cities,” he said. “And at a minimum before anyone is released from an ICE container the federal government needs to be given at least 24-48 hours notice.”

For more than two decades, San Francisco has been considered a sanctuary for people in the U.S. illegally. In 2013, Sheriff Ross Mirkarimi’s office started turning over fewer people under arrest to federal immigration agents for deportation.

ALSO READ: Donald Trump Pledges To ‘Secure Our Border’ Following San Francisco Pier 14 Fatal Shooting

In an interview with CNN on Monday, Mirkarimi said that although Immigration Customs and Enforcement hasn’t upgraded its practices in years, San Francisco’s sanctuary city status has made the city safer.

Sanchez will be arraigned Tuesday represented by the public defender’s Chief Attorney Matt Gonzalez.

A group gathered at the murder scene on Pier 14 Monday afternoon to conduct a prayer service at the site where Steinle was killed.