RICHMOND, Va. (AP) — President Donald Trump’s hardline position on immigration is casting a long shadow over Virginia’s race for governor, with candidates in both parties adjusting their focus to more closely match or oppose the president.

The contest is potential preview of the 2018 midterms, and the growing influence of immigrant voters — particularly in voter rich Northern Virginia — mirror similar changes in other parts of the country that will hold elections next year.

Though immigration law is largely a federal matter, governors can still have an impact on Virginia’s sizeable immigrant population both in tone and policy.

Immigrant advocates said Trump’s election and his early actions to increase immigration arrests have terrified many Virginia families. Jennifer, a 20-year-old undocumented immigrant from Honduras who lives in Northern Virginia, said having a governor who was willing to stand up to Trump would give her hope, while a governor who sided with Trump would increase her fears.

“My whole family is scared,” she said. The Associated Press is not using her full name because she said she and her family members feared being identified by the government for deportation.

Democrats Ralph Northam and Tom Perriello are promising fierce resistance to Trump’s immigration positions and are embracing policies such as allowing undocumented immigrants to obtain driver’s licenses. Virginia Democrats have traditionally been silent on the issue.

Northam and Perriello have sounded different notes on illegal immigration in past campaigns, emphasizing support for a more law-and-order approach. Northam said in a 2011 debate for state Senate that undocumented immigrants can be “somewhat of a burden” on society and while Perriello, a former congressman, advocated in 2010 for policies that would lead them to “self-deport.”

The shift in tone reflects that Democrats no longer feel that they have to play defense, said University of Mary Washington political science professor Stephen Farnsworth.

“It wasn’t that long ago that Democratic candidates hesitated to say anything nice about illegal immigration,” he said.

Spokesmen for Perriello and Northam said their candidates have long records supporting the rights of undocumented immigrants.

On the Republican side, GOP frontrunner Ed Gillespie is walking a tightrope. The former chairman of the Republican National Committee has spent years arguing for a more inclusive GOP.

Now a candidate, Gillespie has vowed to be “very strong” on immigration enforcement, promising greater cooperation between Virginia law enforcement officials and federal immigration officers. He’s also promised to undo state policy that allows children of people living in the country illegally to pay in-state tuition at public universities.

Gillespie also plays up his father’s Irish immigrant background and is running campaign ads both in Korean and Spanish.

“Gillespie has a very constructive history on the issues, and is now stuck between the rock that is Donald Trump and the hard place that is a slice of Republican primary voters,” said Ali Noorani, executive director of the pro-immigrant National Immigration Forum.

Another Republican hopeful, Corey Stewart, is an ardent Trump supporter who has said he wants any person living in the country illegally who is arrested in Virginia to be deported, “no questions asked.” State Sen. Frank Wagner, the other Republican hopeful, also agrees with Trump’s hardline policies.

Gillespie’s efforts to avoid alienating both the pro-Trump GOP base and Virginia’s immigration population are going to be closely watched by moderate Republicans running for in the 2018 midterms, Noorani said.

“How he threads that needle will be a lesson that others will take from,” Noorani said.

Both parties are holding primaries June 13. Current Gov. Terry McAuliffe is barred from seeking a second consecutive term.

There are about a million immigrants living in Virginia, about an eighth of the total population. Most live in voter-rich Northern Virginia, which has swelled with an influx of Democratic-leaning voters in recent years and has helped Democrats win every statewide election since 2009.

The different approaches were on full display when Trump issued his initial order banning travel from seven predominantly Muslim countries in January. Perriello rushed to Dulles International Airport to take part in protests, while Northam called a last-minute news conference to denounce the order.

Gillespie, meanwhile, initially said through a spokesman that he’d been too busy campaigning to read the order a day after it was issued, eliciting mocking jeers from his opponents. A day later, Gillespie issued a carefully worded statement in support of the president’s order.

“As governor, I will work with the federal government to protect our homeland and the safety of Virginians. As the son of an immigrant, I know we can be a secure and welcoming nation at the same time,” he said.