Sen. Robert P. Casey Jr. (D-Pa.) won reelection in a contest against an anti-immigration hard-liner by focusing finding bipartisan solutions to immigration that included more border security. In one of her first ads, Rep. Xochitl Torres Small (D-N.M.), who won a Trump-leaning district along the border, showed herself walking the southern border fence. “We need to enforce our borders and enforce our laws against violent traffickers and criminals,” she said in the spot.

That same strategy could be effective now, say some Democratic advisers, in the face of near-daily attempts by Trump to brand the party as not caring about security.

“Democrats have been accused of being for open borders, and they must rebut that accusation, which is inaccurate,” said Simon Rosenberg, a Democratic strategist who advised Clinton’s 2016 campaign on immigration issues. “Democratic candidates should be articulating what their reasoning is for smart and enforceable border enhancement.”

It’s a shift some candidates have gingerly begun to make. Former congressman Beto O’Rourke (D-Tex.) said weeks before announcing his presidential bid that he wanted to take down the border barriers that divide Mexico and the United States. More recently, he has shifted his position.

“I am not for open borders,” he said in a recent appearance in Iowa. “I do think that there are places where physical barriers along the 2,000-mile U.S.-Mexican border makes sense.”

At a town hall April 7 in Oskaloosa, Iowa, Sanders also pushed back on a voter question that suggested he supported “open borders.”

“If you open the borders, my God, there’s a lot of poverty in this world, and you’re going to have people from all over the world,” Sanders said. “And I don’t think that’s something that we can do at this point. Can’t do it. So that is not my position.”

Ryan, who launched his campaign April 4, says the epidemic of opioid addition in the Midwest has made immigration a pressing issue for many in the region, given the flow of heroin and fentanyl from Mexico.

The key, he says, is to tell voters that Trump is just playing politics with the issue, even as Democrats offer a more compassionate approach to those immigrants now living in the country.

“We could do it a heck of a lot better than him to make them feel more secure,” he said. “They really understand that he is trying to make this a political issue.”