San Francisco has taken its acclaimed illegal immigrant sanctuary status a huge step further by passing legislation that forces police and probation officers to violate federal law in order to protect undocumented youth criminals.

The measure, overwhelmingly approved by the San Francisco Board of Supervisors this week, requires that underage illegal aliens arrested and charged with felonies actually be convicted before police could turn them over to federal immigration authorities for deportation.

The convoluted story of how the law came to be features a politically motivated mayor’s desperate efforts to appear tough on illegal immigrant crime as he seeks statewide office. For years San Francisco has offered illegal immigrants sanctuary, forbidding city employees—including law enforcement officers—from reporting undocumented residents to the feds. The city even offers illegal immigrants official municipal identification cards so that they can enjoy public services and integrate into the community.

Among the most protected are violent youths convicted of serious crimes, many of them repeat offenders. Over the years San Francisco has spent millions of taxpayer dollars to shield them from deportation by housing them in unsecured group homes. The outrageous policy came under fire last year when two illegal aliens who had been convicted of felonies as youths committed heinous crimes as adults.

First a gangbanger (Edwin Ramos) from El Salvador brutally murdered a father and his two sons as they drove home from a family picnic. As a youth Ramos had been convicted of two felonies (a gang-related assault on a bus passenger and the attempted robbery of a pregnant woman). In an unrelated incident, a Mexican gang member convicted of several felonies as a teenager “gutted” a man like a “pig,” according to police.

The atrocities received worldwide media attention and inspired San Francisco Mayor Gavin Newsom to pretend he’s tough on crime because he wants to be California’s next governor. Newsom, an ardent defender of his city’s sanctuary policies, issued an order directing local authorities to turn youth offenders over to federal officials as soon as they’re booked on felony charges. No conviction necessary.

The order incensed the Board of Supervisors who struck back with this week’s veto-proof law to protect young illegal alien thugs. The measure was authored by a county supervisor (David Campos) who proudly boasts that he arrived in the U.S. as an illegal immigrant from Guatemala. Campos has already threatened to take action against the mayor if he doesn’t abide by the new law.

Gavin is standing his ground, claiming that the bill isn’t worth the paper it’s written on. The city attorney had previously issued an advisory saying that the legislation cannot be enforced since federal law prohibits the city from taking any adverse action against a city official or employee who reports a juvenile to federal immigration authorities.

Judicial Watch has sued San Francisco, on behalf of a local taxpayer, over its sanctuary policies and has thoroughly investigated the Ramos triple murder case, obtaining public records relating to his arrest and lengthy criminal history.