Donald Trump, shown here during a rally Friday in Pennsylvania, surprised political strategists with a visit to Virginia Beach the next day. (Justin Merriman/Getty Images)

Donald Trump, never short on campaign shockers, pulled one off Saturday simply by setting foot in Virginia.

The Republican presidential nominee’s rally in Virginia Beach, part of a renewed push here that includes a $2 million television ad buy, flabbergasted political analysts and GOP strategists who have considered the swing state off the table for months.

Trailing Democrat Hillary Clinton by double digits in the latest Virginia polls, Trump will dispatch key surrogates — his children — for a series of visits to Northern Virginia this week. His campaign said Trump and running mate Mike Pence will return to the state “a lot” before Election Day.

“There is absolutely no logical reason for Trump to be spending resources in Virginia,” said Jennifer Duffy, a senior editor for the nonpartisan Cook Political Report. “Especially since there are a handful of very tight states out there that could use those ­resources.”

Virginia-based GOP consultant Tucker Martin wrote on Twitter that the reality star’s chances were as low as they could go in a state that sent George Washington, Thomas Jefferson and six other native sons to the White House.

Republican presidential nominee Donald Trump said, "There are no more decent, devoted and selfless people than our Christian brothers and sisters" during a rally at Regent University in Virginia Beach on Saturday. (Reuters)

“He’s at 29% in Va.,” Martin tweeted this week. “Which is what you would get if you got nominated, burnt down Monticello, and then went on vacation until November.”

Some Republicans are bitter about the Virginia focus, which they variously attribute to inept campaign strategists, the billionaire’s stubborn pride, and even a desire to protect the Trump brand in a state where the family owns a winery and a golf course. The most positive take was that it was a head fake — a bid to project strength nationally following reports, disputed by the campaign but damaging nonetheless, that Trump was pulling out of Virginia.

“I think it’s an absolute joke, the notion that he would continue to make a pitch for Virginia,” said a senior GOP strategist, who spoke on the condition of anonymity to be frank about the party’s nominee. “It is the most unprofessional campaign in modern presidential history. Don’t assume there’s a strategy.”

Duffy said there was no use trying to explain it.

“Logic hasn’t applied to anything this campaign has done,” she said. “It’s time to stop looking for it.”

Trump campaign officials insist he remains viable in Virginia, which has 13 electoral votes.

They put little stock in the polls, noting that many surveys seemed to underestimate support for ­Republicans in the 2013 race for Virginia governor and the 2014 contest for one of the state’s U.S. Senate seats. Democrat Terry McAuliffe beat Ken Cuccinelli II in the governor’s race and Sen. Mark R. Warner defeated Ed Gillespie for Senate, but both wins were squeakers, not the comfortable victories that had been projected.

“Look at Ken Cuccinelli, Ed Gillespie — Virginia breaks so late,” said Mike Rubino, Trump’s Virginia senior adviser. “For a state that breaks late, why would you pull out at the end? This is when it gets fun.”

John Fredericks, a conservative radio-show host and chairman of Trump’s Virginia campaign, also said it made sense to stick with Virginia.

“We know that we can pull the upset off,” Fredericks said. “I’m telling you we have a chance to win this state. Otherwise we wouldn’t be putting in resources in the final 20 days. Nobody does that.”

Many political strategists said Trump would be better served camping out in Florida, North Carolina, Ohio and Pennsylvania.

Virginia was expected to be very much in play this year. After helping send Lyndon B. Johnson to the White House in 1964, Virginia went reliably red in presidential races until Barack Obama came along in 2008. He won the state again in 2012.

Virginia’s demographic trends favor Democrats in statewide ­races. And Clinton picked a Virginian, Sen. Tim Kaine, as her running mate. But Republicans came close to beating Democrats in the last races for governor, attorney general and U.S. Senate. And they hold a majority of the state’s seats in Congress and the General Assembly.

[Stars align for Clinton in Virginia as swing state appears solidly in her column]

Some officials with the Trump campaign and the Republican ­National Committee never thought it made much sense to focus on Virginia, in part because the state did not have a Senate race on the ballot.

Corey Stewart, Trump’s former Virginia co-chairman, has complained bitterly about those calculations. The campaign fired him on Oct. 10 after he joined a protest at RNC headquarters in which Trump supporters accused establishment Republicans of diverting funds raised for Trump in Virginia to down-ballot races in other states. Stewart said he was forced to appeal directly to members of the Trump family but never got any follow-through from the RNC.

“It’s been a pattern of reaching out to Trump family, pressure put on the RNC, the RNC temporarily say, ‘Okay, fine. We’ll do that,’ and they promise the resources but they never materialized,” Stewart told The Washington Post shortly after his firing.

Asked more recently for comment, Stewart declined to discuss the RNC but said “the Trump family is very personally committed to trying to win Virginia.”

[You’re fired: Trump campaign dumps Virginia state chair Corey Stewart]

The campaign’s commitment to Virginia has shifted at times as leaders at Trump headquarters have come and gone, Fredericks said. It reached a low point under Paul Manafort, who resigned as campaign chairman in August, Fredericks said.

“We didn’t have a down-ballot [Senate] race, so we got nothing from him, zero,” he said. “We got totally hosed. When Trump fired him, that’s when we . . . got the resources we’d been needing.

Manafort did not respond to a request for comment.

Fredericks said current campaign leadership, as well as the RNC and the Trump family, have been attentive to Virginia, but it remains a balancing act.

“When you’ve got limited resources to allocate in a campaign . . . obviously there’s gonna be some within the Republican National Committee who feel, give the resources to the states that have the down-ballot races,” Fredericks said. “That shouldn’t be a shocker to anybody.”

Until the new ad campaign was launched last week, Trump had been off the air in Virginia since about Labor Day. But Trump and Pence never stopped visiting the state. Trump has made at least eight visits since July, five of those since September. Pence has made four trips in October alone, one of them a three-day tour coinciding with the vice-presidential debate in Farmville.

Trump’s team announced the TV buy and the Saturday rally at a low point in the Virginia campaign. On Oct. 13, NBC reported, based on anonymous sources, that Trump was pulling out of Virginia. The newly ousted Stewart confirmed the report. The Trump campaign acknowledged it was moving a handful of staffers to North Carolina for early voting but said they would be back.

Days later, it offered the ads and planned appearance as proof that it was doubling down in the state.

[Trump campaign insists it’s not quitting in Virginia, just moving staff for now]

“Donald Trump’s kind of one of those guys who competes because he’s got a chip on his shoulder,” said one Republican insider, who spoke on the condition of anonymity in order not to offend Trump. “I think it’s more a pride thing. He’s not a quitter. He hasn’t pulled out of any states.”

Tom Davis, a moderate former Republican congressman from Northern Virginia, finds Trump’s continued push in Virginia surprising. But he does not dismiss the strategy entirely.

“As you look at his path to victory at this point, Virginia is probably not their highest priority,” he said. “But I would also add Democrats have always over-polled in Virginia. You look at Cuccinelli’s race. . . . I’d also add this is a hard campaign to second-guess because he beat everyone in the primaries.”

In any case, the whole thing reminds Davis of a movie.

“Have you ever seen the movie ‘How to Lose a Guy in 10 Days’?” he asked. “She’s got to lose this guy. It’s Kate Hudson. He keeps coming back. It kind of reminds me of Trump.”