Updated

San Francisco leaders have retained strict protections for people who are in the country illegally, with clarifications.

The Board of Supervisors voted unanimously on Tuesday for a measure calling for law officers to notify Immigration and Customs Enforcement if a defendant is charged with a violent crime and has been convicted of a violent crime within the past seven years.

The measure also allows leeway for the city's sheriff to consider contacting federal immigration authorities in the cases of defendants charged with a felony if they have been convicted of other crimes in the past.

The vote Tuesday by the Board of Supervisors came nearly a year after a Mexican national was accused of killing a woman along a popular pier. The slaying sparked a national debate on how to handle criminal suspects in the U.S. illegally.

Advocates of sanctuary protections say a clear division between local law enforcement and federal immigration authorities is needed to foster trust. The law dates back to 1989.

The proposal's main sponsor, Supervisor John Avalos, and Sheriff Vicki Hennessy had been deadlocked on the issue for weeks as she sought greater discretion to work with ICE. As a constitutionally elected officer, she does not have to follow board orders.

Immigration advocates cheered the compromise, even as they maintained that local law enforcement should be entirely separate from federal immigration authorities.

The killing of Kate Steinle in July 2015 and the arrest of Juan Francisco Lopez-Sanchez put San Francisco's leaders on the defensive as critics and outside politicians called for a change in the city's sanctuary law.

The sheriff at the time cited the law in defending the release of the man, a repeat drug offender and habitual border-crosser. Then-sheriff Ross Mirkarimi — already embattled over a number of professional and personal gaffes — lost re-election to Hennessey, who said she would have considered greater communication between the city and federal government.

Hennessey said Tuesday that she would not have contacted ICE in the case of Lopez-Sanchez because he was not wanted on a felony.