Last month, Mr. Buttigieg wrote in The Huffington Post about why Mr. Berstain’s community, considered to be a conservative area, was largely sticking up for “an undocumented neighbor.” In it, he wrote that supporting Mr. Beristain is in line with his community’s values: “hard work, small business ownership, suspicion of overbearing government and support for family.”

In the November election, St. Joseph County — which includes Mishawaka, where the Beristains live — was split nearly evenly between Mr. Trump and his Democratic opponent, Hillary Clinton. But Mr. Buttigieg says that Mr. Beristain’s deportation has affected some Republican residents’ opinions of the president.

“I got one letter from somebody who knows the family personally who’s also a Trump supporter basically saying, ‘Look, this isn’t what we thought we were voting for,’ ” Mr. Buttigieg said. “But then again, political habits die hard.”

The reactions have not all been supportive. The mayor said that the Beristains’ eighth- and ninth-grade daughters were on “the receiving end of some ugliness at their school.” He added that there had been some negative responses from people online, who have said that Mr. Beristain does not have an excuse because he had years to try and become a citizen.

The mayor said it was important to view the story as a human one, not just a political one. “That’s equally applicable to people in the anti-Trump world who are saying that somehow this family deserve it,” he said. “I think this is a moment where compassion has to come first.”

Mr. Ansari — who has been helping the family and has assembled a team of immigration lawyers to provide them counsel — said the deportation was unlawful and a surprise because the lawyers had several pending motions on behalf of Mr. Beristain, which were being relayed to immigration officials.