Bill Hartzell, whose wife’s grandmother was murdered by an undocumented immigrant in 2013, in Council Bluffs, Iowa. (Aaron P. Bernstein/For The Washington Post)

Illegal immigration makes Bill Hartzell seethe. The memories are fresh from the afternoon in October 2013 when he saw his wife’s 93-year-old grandmother bloodied and unconscious, after being beaten and raped in her house by a 19-year-old Mexican who crossed the border and never left.

His outrage is driving Hartzell to vote in Monday’s Iowa presidential caucuses for Sen. Ted Cruz (R-Tex.), who has vowed to battle the “sanctuary cities” that refuse to help the feds deport illegal immigrants. Cruz has said that he would block these localities from receiving federal funds for law enforcement — an idea that makes perfect sense to Hartzell.

Except for when it applies to the place where he lives.

Pottawattamie County’s sheriff adopted a sanctuary policy in 2014. Hartzell knows the sheriff. He trusts the sheriff. And he is uncomfortable with how his county, which includes Council Bluffs, would lose at least a million dollars should a President Cruz carry out his threat.

“For us in Council Bluffs, it’s a little more tricky issue,” he said. “This isn’t San Francisco.”

With illegal immigration roiling the GOP electorate, the party’s presidential candidates have spent months blasting sanctuary cities as bastions of liberal naiv­ete and bleeding-heartedness gone awry. No place symbolized this mind-set better, they have said, than San Francisco, where last year, 32-year-old Kathryn Steinle was allegedly murdered by an illegal Mexican migrant.

But there is an awkward, and unstated, element to the hostility toward sanctuary cities.

In Iowa, at least 26 of the state’s 99 counties are deemed sanctuaries — including some of the state’s most conservative.

The designation is an informal one, assigned by activists on both sides of the immigration debate. Governments are generally considered sanctuaries if local officials refuse to honor requests by U.S. Immigration and Customs Enforcement to hold onto suspected illegal immigrants arrested on minor charges while fed­eral agents figure out their status.

After a federal appeals court ruled in 2014 that these requests — known as “detainers” — were optional, the American Civil Liberties Union alerted local sheriff’s departments that they would be subject to lawsuits if they held a citizen without a proper warrant. Nearly 300 jurisdictions nationwide, conservative and liberal, have opted not to take that risk.

Typically, the decisions that lead to a community earning sanctuary status are made without fanfare or public debate. Instead, the refusal to cooperate with ICE usually comes from a police chief, a sheriff or a government attorney — not necessarily a politician looking to extend an act of mercy toward illegal ­immigrants.

Republican presidential contenders on the campaign trail have avoided such details. Others have joined Cruz in demanding that local governments face penalties for not assisting immigration officials. At times, the candidates have blasted sanctuary cities while standing in one.

Sofia Sandoval, family support services coordinator at Centro Latino, at her office in Council Bluffs, Iowa. (Aaron P. Bernstein/For The Washington Post)

“We will finally, finally, finally secure the borders and end sanctuary cities,” Cruz said to applause recently in the public library in Onawa, Iowa — in a county that has a sanctuary ­policy.

“If you are a sanctuary city, you will lose your federal funding,” Sen. Marco Rubio (R-Fla.) declared this month to an eager audience at a hotel in Coralville, Iowa, which also has a sanctuary policy.

“Crap” is the word that Donald Trump, the GOP front-runner, has used across the state to describe sanctuary cities.

The dynamic illustrates the disconnect between hard-edge, campaign-year rhetoric on illegal immigration and the complications of enacting policies in local communities.

Pottawattamie County Sheriff Jeff Danker said that he did not want his jail to keep anyone without a proper warrant. Keeping someone longer for the sake of immigration officials, he said, could be a civil rights violation.

The presidential candidates are threatening to take millions of dollars from local communities over a relatively small disagreement, Danker said. ICE only issued 13 detainer requests between November 2014 and November 2015 in Pottawattamie, according to a Syracuse University study. The local jail here received about $1 million in federal funds last year.

Danker, who describes himself as a conservative, said he hoped the presidential candidates’ focus on sanctuary policies was just political bluster.

“When you bring things down to a local level, things are not so clear-cut,” he said.

Over the next few days, Danker expects a flurry of phone calls and visits from presidential campaigns. Trump is expected to visit Council Bluffs, as is Democratic front-runner Hillary Clinton.

The city, which has a dual identity as a small town nestled beside endless rows of cornfields to the east and as a suburb of metropolitan Omaha to the west, is vote-rich and not particularly ideological. Twenty-seven percent of voters were registered as Democrats, 37 percent are Republican, and the rest are affiliated with no party at all.

In a county of 93,000 residents, about 6 percent are Hispanic or Latino, according to census data. Those immigrants have largely supplemented an aging workforce on farms and in factories as younger white residents decamp for cities, according to Melvyn Houser, a corn and soybean farmer who serves on the county’s board of supervisors.

Houser, a Republican who said he plans to caucus for one of the former governors in the field, said that he believes GOP candidates who talk about having the federal government punish sanctuary cities are contradicting traditional conservative values of limited government and local control.

“This isn’t Texas or Arizona, where there are issues at the border and its more of a burden on the local schools and hospitals,” Houser said. “If the federal government wants something done, they should get their act together and do it. They shouldn’t try and take away funding while we get stuck with all the work and responsibility.”

But anti-illegal-immigration activists say the issue is far simpler than the sheriff or his backers suggest.

“That’s a clear sanctuary policy,” said Jessica Vaughan, director of policy studies at the conservative Center for Immigration Studies. “This county is choosing to obstruct the work of the ­government.”

Vaughan acknowledged that “there is no settled law” on the legal risks of detaining immigrants. Still, she added that a plethora of other local governments — including in such cities as Dayton, Ohio, and Salt Lake City — have insisted on complying with federal requests “because it’s the right thing to do.”

Lynne Branigan, a former Council Bluffs City Council member, expressed shock when a reporter told her that her own community was deemed as having a sanctuary policy.

“Based on what happened in California, I absolutely don’t agree with sanctuary status,” Branigan said. “I’m not versed in all it means, but believe me, I’m going to find out.”

In Iowa, immigration can be a messy and sometimes ethereal issue.

Politics and practicality are often discussed at Barley’s bar and grill in downtown Council Bluffs, where owner Matt Johnson has hosted town halls for several candidates, which explains why there are “Jeb!” and “Bernie Sanders 2016” stickers on a bar table. But few people seem to want to work in the kitchen at $10 an hour, explaining the “Kitchen Jobs Available” sign.

“We need immigrants here because we don’t have enough people for these jobs,” said Johnson, who has supported former Texas congressman Ron Paul and Sen. John McCain (R-Ariz.) in past Iowa caucuses. When it comes to such issues, Johnson tended to be as conflicted as his customers. “But Christie was here talking about enforcing the rule of law, which no one seems to be doing anymore.”

Further down, at the bar, a man who feared “Bernie Sanders is gonna break our hearts if he doesn’t win,” said he had no problem with the sheriff’s department’s stance on cooperating with federal officials. It seemed unfair to him that anyone, even an undocumented migrant, could be detained without a ­warrant.

“Is that even legal?” asked Tim Moon, 65. “The problem with illegal immigration is in the first word: illegal. So we should make sure that we are acting legally.”

At another table, business owner Bill Letuli, 49, said he felt “bad for the kids who were here who would be sent back to dangerous places.”

And yet, he worried about the impact of a mass migration if the country did not use more deterrents. Already, he said, nearby meat-packaging towns such as Denison have seen significant demographic shifts as companies employed more immigrants who would accept lower wages.

“Many are working hard, no doubt, but also we don’t fully know how many are illegals,” Letuli said. “We don’t know who they are and what they are giving back in taxes. We can fix these problems, but someone needs to do it. That place has completely changed.”

He wondered whether Pottawattamie would some day change, too.

Locals estimate that since 2000, the number of Hispanics living in the city of Council Bluffs has doubled to about 4,000. Stores offering “authentic Mexican food” with menus in Spanish are popping up, and the Latino community center in 2014 expanded its office spaces to have more citizenship classes and teach English.

In a wood-paneled hall at El Centro Latino on a recent day, three women practiced English with one another. All feared revealing their full names might get someone they know in ­trouble.

“I became citizen because I want to make things easy for my kids,” said Maria, 38, who moved from Mexico six years ago. “And now, I get to vote even though many of my friends can’t.”

The English soon turned to fluid conversation in their native language. An undocumented woman from Mexico named Maricela, 26, mentioned how she recently saw a deportation raid at a nearby house.

At the very mention of a “raid,” Laura, 34, became so anxious that she could not sit down. She said that she had temporary protective status from El Salvador and married a man who was here illegally. Now her family lived in so much fear of a deportation raid that she moved the television to the back of the house, so ICE officials might not hear any noise if they decided to knock on her door.

Six years ago, Laura recalled, her husband got pulled over for driving past a stop sign. The following morning, ICE knocked on their door and asked for him while he was in the shower.

“And they arrested him, naked,” she said. They served him an order to leave the country. He never did.

“Why him? He lives a good life. He just wants to make things better for his kids,” Laura said.

As the three women spoke, a family coordinator Sofia Sandoval walked in to calm things down. She told them a story about an undocumented man who was arrested at a traffic stop in a nearby town a few weeks ago. He stayed in jail for a day.

“Then they let him go,” she said. “ICE never came back for him.”

Laura said it was “a nice thing to happen, if it’s true.” Maricela said that she had heard of policies like that on television.

“Ah, sanctuary,” she said in English. “I didn’t know it was like that here. Have they been keeping it a secret?”

Karen Tumulty, Katie Zezima and Sean Sullivan contributed to this report.