Raul Reyes is the 34-year-old mayor of El Cenizo, Texas, a sweltering border town of 3,200 that sits beside the Rio Grande, where nearly all the residents are Latino, many are immigrants, and quite a few are undocumented too. It’s a sanctuary of sorts, a town that, since 1999, has had a policy prohibiting local police officers from asking about someone’s immigration status. It’s the town where Reyes was born and raised and a town whose residents he cares for fiercely.

And so, when the governor of Texas, Greg Abbott, signed his ultra-reactionary anti-immigrant bill SB 4 into law in early May, Reyes did not hesitate. Despite El Cenizo’s small size, despite severe financial constraints, and despite the potent power of a Republican-dominated state government, the mayor decided that the town had to respond forcefully, and fast.

“Someone,” he says, “had to do something about it.”

On May 8, less than 24 hours after Abbott had scratched his signature on SB 4, El Cenizo, along with Maverick County and the League of United Latin American Citizens, sued Texas in federal court, arguing that “the extraordinarily punitive law” violated a diverse slew of constitutional protections, including the First, Fourth, and 10th Amendments. The new law, which cracks down on sanctuary policies across the state, includes language that imposes harsh penalties on local governments and officials who refuse to cooperate with federal immigration authorities.

El Cenizo’s legal challenge was the first brick in what has become a towering barricade of lawsuits, protests, and grassroots agitation meant to block the law from taking effect this coming September. Indeed, the tiny town has a movement behind it. Since early May, the state’s four biggest cities—Austin, Houston, San Antonio, Dallas—as well as numerous sheriffs’ departments, county governments, and civil-society groups, have all sued in an attempt to overturn the bill. Protests, rallies, and impassioned grassroots campaigns, meanwhile, are sweeping across the state. In recent weeks, more than a dozen Dreamers were arrested near the capitol building as they engaged in civil disobedience to protest deportations under Trump and try to stop SB 4. A troupe of young women dressed in bright gowns and celebrating their quinceñeras showed up at the legislature to dance and register their disgust with lawmakers. In late July, scores of progressive elected officials from cities around the country converged in Austin to denounce the law.

As the long, hot summer of 2017 rolls on, Texas is roiled by a local, mostly urban, resistance.

This bill is reckless, it is dangerous, it is discriminatory, and it opens up the door to racial profiling,” says Reyes. “In the most powerful country in the world, no person should have to live in fear.”

Yet instilling fear, says Reyes, is what SB 4 is all about. It injects terror into the hearts and heads of undocumented immigrants and their allies.

Though some have described it as a law that bans sanctuary cities, in truth SB 4 is something more, something worse. It is both a ban on sanctuary cities and an authoritarian preemption law. Among other provisions, the legislation bars local governments and police departments from adopting, enforcing, or even endorsing any policy that “prohibits or materially limits the enforcement of immigration laws.” It also punishes cities, counties, and police departments that in any way prohibit local prosecutors and law-enforcement personnel from assisting federal immigration agents or inquiring about the immigration status of an arrestee. If a local government is found in violation of the law, it can be fined up to $25,000 a day in civil penalties. If elected officials are found in violation of SB 4, they can be removed from office.

Greg Casar, a young Austin City Council member who has emerged as a vital leader in the fight against SB 4, sees the law as a crackdown on Texas’s emboldened immigrant-rights movement.

“As resistance grows, and progressive organizing grows, especially in Texas cities, we have seen a backlash of repression from the state government,” says Casar, who was arrested during an anti–SB 4 sit-in in Governor Abbott’s office in May. “I don’t see SB 4 as just a political ploy, but also a direct retaliation against the growing immigrant-rights movement across the state.”

In the last year alone, that rising movement has notched numerous victories. Casar points, as an example, to the recent campaign in Houston to pressure the county sheriff to cut ties with Immigration and Customs Enforcement, or ICE. Led by grassroots groups like United We Dream and the Texas Organizing Project, among others, the campaign found success in February when the sheriff, a newly elected official named Ed Gonzalez, announced that he would end his department’s participation in ICE’s 287(g) program. The program enabled some Houston area police to train and cooperate with federal immigration agents. Other Texas sheriffs, including Sally Hernandez of Austin, have also scaled back their cooperation with ICE in recent months.

SB 4 is aimed at annihilating progressive achievements like these, and come September it very well might. Yet the law has had unintended consequences, too: It has fueled “a statewide campaign of organizers and community members demanding that their local governments fight back,” says Casar.

That campaign got started with a series of protests that rocked the state capitol this spring and summer, including the day-long sit-in on May 1 during which Casar was arrested and a rally on May 29 during which hundreds of people converged inside the legislature, chanting, unfurling banners, and interrupting the work of the gathered lawmakers. “SB4 is Hate” and “Fight Back” and “See you in court!” their signs read.

Organizers, meanwhile, began working to pressure local-government leaders across the state to file or join lawsuits like El Cenizo’s to snuff out SB 4 before it could even take effect.

In Houston, organizers with United We Dream and other groups showed up week after week at the City Council this summer to convince the body to take legal action against the law. The organizers’ message to decision-makers was simple: “If you do not join the lawsuit, it means you support SB 4,” says Oscar Hernandez, a United We Dream activist and a 29-year-old undocumented immigrant who arrived in the United States when he was 2 years old. “If you aren’t actively fighting against this, you are aiding and supporting it.”

On June 21, in a 10-6 decision, the Houston City Council took heed and agreed to join Austin, San Antonio, and other cities in their lawsuit against the state. Hernandez says campaigners there are now trying to convince the county government to join the lawsuit as well.

A similar dynamic went down in Dallas, where staff and allies with the Workers Defense Project, a Texas-based immigrant- and labor-rights group, filled City Council offices for two weeks and flooded local officials with phone calls urging them to get into the fight.

“This movement that began to call on cities to enter into the lawsuit has taken on a life of its own,” says Jose Garza, the executive director of the Workers Defense Project. “We find out on a weekly basis about new communities who are putting on actions, going to meet with city councils and asking them to engage in litigation.”

On June 7, Dallas too announced its intention to join the legal challenge against SB 4.

The various lawsuits brought by Texas’s cities, from El Cenizo and El Paso to San Antonio to Austin, have been consolidated and are presently being heard in federal court in San Antonio, where District Judge Orlando Garcia is considering the plaintiffs’ request for an injunction against SB 4 as the legal challenge moves forward.

Efrén Olivares, an attorney with the Texas Civil Rights Project who is representing El Paso County, its sheriff, and the Texas Organizing Project Education Fund in the lawsuit, believes the legal battle could end up before the Supreme Court.

“Whichever way it goes, the losing party will appeal or maybe both parties will appeal,” he says. “And whoever loses the appeal is going to seek [certiorari],” or permission to appear before the high court.

Organizers on the ground, though, are not waiting on judges to decide the issue. They are preparing for the worst possible outcome. Garza, with the Workers Defense Project, says civil-society groups around the state are working diligently to make their communities more resilient in case SB 4 does take effect in September. His group is holding regular know-your-rights training at town halls and private homes. They are also at work on a “community-based deportation defense program” that will be capable of rapidly mobilizing people to take action whenever someone is apprehended by immigration authorities. The goal, he says, is to turn “every encounter with law enforcement that results in detention into an action, into an organizing moment that rallies the community” around affected families.

SB 4 has sparked longer-term strategizing, too. Michelle Tremillo, the executive director of the Texas Organizing Project, which has outposts in Houston, Dallas, and San Antonio, believes SB 4 could radically shift the balance of power in Texas in the years ahead. She sees this bill as akin to Proposition 187 in California, an anti-immigrant ballot measure passed in the state in 1994 and backed by the Republican Governor Pete Wilson. That proposition outraged immigrants and their allies across the state, mobilized a generation of Latino voters, damaged the Republican Party, and helped to transform California into the progressive stronghold it is today.

“This could be that moment for many Latinos in Texas, this could be our California moment,” says Tremillo, whose group mobilizes low-income and working-class voters and also lobbied cities around the state to join the SB 4 lawsuits. “Prop 187 is largely considered the catalyst in the shift in California, it is seen as the catalyst that turned Latinos into voters, and that is a big part of the work we are doing on the ground. We want to make sure people see that, that people understand who was for them and who was against them.”