WASHINGTON, D.C. — The political ads that aired in the Washington metro region in the fall of 2017 made many stop in their tracks.

One of them showed a truck with a Confederate flag barreling down a neighborhood as a child urgently warned his friends — a group of children of color — to run. The truck with the Confederate flag had a bumper sticker with the name Gillespie on it.

“Is this what Ed Gillespie and Donald Trump mean by the American Dream?” asked a voice at the end of the ad, as a couple watched on television ominous scenes of an angry mob carrying lit torches in the night. The scenes were reminders of an August weekend of racial tension that erupted in Charlottesville, Virginia, when white supremacists organized a rally that ended up in violent clashes and the killing of a woman protesting the rally.

The ad was meant as an attack against Republican candidate Ed Gillespie, who ran a Trump-style campaign for Virginia governor, warning of the dangers of sanctuary cities and immigrants in the country without legal permission.

A different ad in support of Gillespie depicted news reports about the notorious MS-13 gang and its members’ crimes, and insinuated that places that declared themselves “sanctuary cities” or said they support immigrants give rise to such violence.

In the end, the ad ended up not just alienating Latinos, who were the ones depicted in the ad, as much as black voters who went to the voting booth in opposition and gave a victory to Democrat Ralph Northam in Virginia.

A survey of voters polled before and after the election by the African American Research Collaborative, in conjunction with Latino Decisions, found that the Gillespie ad turned off support for the candidate, who had enjoyed a strong showing among black voters just a month earlier. When the two groups released in November the results of the survey, they said black voters “moved” to a different candidate in part because of the ad.

Some say that the public shows of racism the country witnessed in 2017 in places such as Charlottesville, coupled with the negative depictions of immigrants, particularly Latinos as criminals, that have seeped into the political arena, will end up backfiring against politicians trying to appeal to some voters who helped elect Donald Trump. The African American Research Collaborative survey shows what some say is a resolve to reverse what they see as attacks on minorities in the U.S.

Sara Benitez, Latino program director for the interfaith group Faith in Public Life in Washington, said political attacks based on “racial divides, fear of Latinos, fear of Muslims, African-Americans, doesn’t work. It’s not a winning campaign strategy.” She said what happened with the December vote in Alabama, and earlier in Virginia, “is a sign of what’s to come in 2018.”

Just before Alabama held a special election to pick a new senator in December, the African American Research Collaborative survey had said the state, which hadn’t seen a Democrat elected to the position in 25 years, could be one of five states with congressional races where “black votes could matter.”

On Dec. 12, the organization’s warning proved to be well-founded as Democrat Doug Jones won the seat vacated by Jeff Sessions, who vacated the spot when he became United States Attorney General. Analyses by various groups said female black voters impacted the race as they turned out for Jones.

“If not for black women, Doug Jones might very well have given a concession speech on Tuesday night,” wrote Anthea Butler, a Catholic associate professor of religious studies and Africana studies at the University of Pennsylvania, in a Dec. 14 article for America magazine. Butler wrote that black voters, particularly women, played an important role in Jones’s victory against controversial Republican candidate Roy Moore, who still won a majority of Alabama’s white vote even though he had been removed from office while he was a judge, said the country was “great” during slavery, and faced repeated allegations of inappropriate behavior toward teenage girls.

The vote of black women as values voters, Butler wrote, played a key role in the race.

The African American Research Collaborative-Latino Decisions survey pointed out that some of the takeaways from 2017 for the highly anticipated 2018 congressional races is that “race-baiting and criminalization will backfire” for politicians using such tactics, resulting in an increasing number of black voters at the voting booth, even if they’re not the targets of the negative messages. The survey pointed to Alabama, Florida, Missouri, Ohio and Wisconsin as “battleground states in which black voters will be critical to the outcome.”

Minority groups are seeing how “we’re all being almost scapegoated,” said Benitez, referring to rhetoric that tells people “be afraid of people of color, immigrants,” and even certain religious groups such as Muslims, she said. Those insults, even if the voter is of a different background than the group being maligned, will affect how he or she votes, Benitez said.

“We’re uniting with each other against them,” she said.

That’s something that should have those who use certain tactics “shaking in their boots,” said Butler to Catholic News Service, because there is a sustained get-out-the-vote effort underway. Even attempts at “gerrymandering” the black vote, will not have effect, Butler said. Events such as what happened in Charlottesville had too profound an effect, she added.

“In the last 24 hours, hatred and violence have been on display in the city of Charlottesville. I earnestly pray for peace,” said Bishop Francis X. DiLorenzo of Richmond, Virginia, in a statement on the afternoon of Aug. 12, about the city in his diocese. It would be one of his last statements before he died a few days later.

He was reacting to a rally of hundreds of men and women, identified as white nationalists, carrying lit torches on the campus of the University of Virginia. Another mass of people arrived to protest the rally, leading to clashes between the two groups and which culminated when a man driving a car rammed into a crowd Aug. 12, killing 32-year-old Heather Heyer and injuring at least 20 others.

For reasons other than political, Catholic bishops, clergy and many members of the church spent quite a bit of 2017 denouncing the violence, the racism and anti-immigrant sentiment the country has experienced.

Cardinal Daniel N. DiNardo of Galveston-Houston, president of the U.S. Conference of Catholic Bishops, called the events in Charlottesville “abhorrent acts of hatred” in an Aug. 12 statement, and said they were an “attack on the unity of our nation.”

Miami Archbishop Thomas G. Wenski, addressing a bipartisan immigration group Nov. 28, spoke out against the demonization of migrants and against labeling them “lawbreakers, equating them with terrorists intent on hurting us.”

And addressing racism was a major topic when the U.S. bishops met in Baltimore in mid-November for their annual fall general assembly. Chicago Cardinal Blase J. Cupich spoke of dangers of Catholics falling prey to and believing “poisoning rhetoric.”

For those like Benitez, the way to combat the sentiments means voting against those who espouse them and thinks voters will speak loudly in 2018.

“People are saying that if this is happening to this (particular) community, what’s going to happen to us?” she said.