Just days before it was scheduled to go into effect, a federal judge has blocked most of Texas’s discriminatory “show me your papers” law:

U.S. District Judge Orlando Garcia issued an injunction that prevents Texas Senate Bill 4 from being implemented while a lawsuit challenging the law winds its way through the federal courts. The ruling marks a victory for immigrant rights groups and several local governments ― including those of Austin, Houston, San Antonio and El Cenizo ― that argued the law unconstitutionally requires police to do the work of federal authorities and would lead to racial profiling.

“The decision served as a legal blow to one of the toughest state-issued immigration laws in the country and puts the brakes on a measure backed by the Trump administration that critics had called anti-Latino,” noted the New York Times.

Immigrant rights advocates, local law enforcement, and community leaders fiercely opposed the legislation, which turns local police into federal immigration agents and allows them to ask the legal status of anyone they detain for any reason. Numerous police chiefs in the state flatly stated that the law will make communities less safe because it will make immigrants and Latinos fearful of reporting crime.