ALBUQUERQUE, N.M. >> Donald Trump is traveling to New Mexico and Virginia in the campaign’s final days, taking a risky detour from the seven battleground states to spend time in places where Republican presidential candidates have not won in decades.

The former president campaigned in Albuquerque, New Mexico, on Thursday and was scheduled to visit Salem, Virginia, on Saturday.

The Trump team is projecting optimism based in part on early voting numbers and thinks he can be competitive against Democrat Kamala Harris in both states — New Mexico in particular, if he sweeps swing states Nevada and Arizona.

That hope comes even though neither New Mexico nor Virginia has been carried by a GOP nominee for the White House since George W. Bush in 2004.

Over the past few months in particular, the battleground states — Arizona, Georgia, Michigan, Nevada, North Carolina, Pennsylvania and Wisconsin — have seen a constant stream of candidate visits, and residents have been bombarded with political ads on billboards, televisions and smartphones. In the past two weeks alone, presidential and vice presidential candidates have made 21 appearances in Pennsylvania, 17 in Michigan and 13 in North Carolina.

In the 43 other states, a candidate visit is an exciting novelty.

Trump retains fervent pockets of support even in states that vote overwhelmingly against him, and he can easily fill his rallies with enthusiastic supporters.

He has made other recent detours from the states most at play, holding rallies at Madison Square Garden in New York and in Coachella, California — states that are even more solidly Democratic than New Mexico and Virginia.

Those events satisfied Trump’s long-shot claims that he can win both states, but were also aimed at earning maximum media attention as his campaign seeks to reach voters who do not follow political news closely.

Trump also showed up in staunchly Republican Montana, and both Trump and Harris campaigned on the same day last week in Texas, which Democrats last won in 1976.

Those trips served other purposes, such as highlighting issues important in a state or supporting House or Senate candidates.

Trump said in Albuquerque that he could win the state as long as the election is fair, repeating falsehoods about rigged past elections.

“If we could bring God down from heaven, he could be the vote counter and we could win this,” Trump said. He added he’s visiting New Mexico because it’s “good for my credentials” with Hispanic voters.

Trump’s strategy carries risk.

After losing to Trump in 2016, Democrat Hillary Clinton was criticized for going to Arizona late in the campaign instead of spending time in Wisconsin, Michigan or Pennsylvania, states that ended up deciding that election.

Arizona is now a battleground, but it wasn’t considered particularly competitive eight years ago, when it voted for Trump by a 4-percentage point margin.

“I don’t think there’s any strategy,” said Bob Shrum, a longtime Democratic political consultant who worked on numerous presidential campaigns and now leads Center for the Political Future at University of Southern California. “I think he insisted on doing it. It makes no sense.”

The planned visit to Albuquerque brings Trump and his immigration stance to a border state with the nation’s highest concentration of Latino voters, highlighting the campaign for Hispanic supporters.