A number of Republican sheriffs who for years worked hand-in-hand with Immigration and Customs Enforcement (ICE) were ousted from office by Democrats this week. “The victories were emblematic of a greater shift among the electorate,” Think Progress reported, “a backlash to Republicans’ overall racist, anti-immigrant midterm messaging.”

Among the Democratic victories was the defeat of Republican Donnie Harrison, who had served as Wake County, North Carolina’s sheriff since 2002. Harrison had partnered with ICE under the 287(g) program, through which “ICE deputizes local or state law-enforcement agencies to enforce federal immigration laws.” In reality, it’s a program rife with racial profiling, costs counties millions, and tears families apart.

Democrat Gerald Baker pledged to stop that, saying that “you’ve got a guy who may get stopped out there for expired tags or no driver’s license and he gets in there and they put that detainer on him and he may have a wife and whole house full of children, babies and everything else.” On Tuesday, the voters agreed with him and elected him the new sheriff. “I’m a little in shock,” said Felicia Arriaga, a professor of sociology at Appalachian State University.

While Hennepin County, Minnesota, Sheriff Richard Stanek was not officially a part of 287(g), he said last summer that he would go “above and beyond” to help target undocumented immigrants. This week, he lost to Democrat Dave “Hutch” Hutchinson. “We’re not going to deal with ICE,” he said, “because we have an obligation to our tax-paying people, and our people who live, visit and work in Hennepin County, to make sure they’re safe.”

It wasn’t just anti-immigrant figures that got stopped in their tracks. In Oregon, an effort by sheriffs and anti-immigrant hate group FAIR to end the state’slongstanding sanctuary policies and force police to collaborate with Trump’s deportation forcelost by a massive 63-37 percentmargin, immigration rights advocacy group America’s Voice said. Nationally, other anti-immigrant candidates running for federal office were also defeated by voters.