President Obama delivered the closing argument for Terry McAuliffe’s campaign for Virginia governor Sunday, telling an eager crowd in Arlington County that Tuesday’s vote would determine whether the “extreme” forces behind the government shutdown would gain control of Richmond.

“This election is going to say a lot about Virginia’s future and about the country’s future,” Obama told a packed gym at Washington-Lee High School.

Lately, Obama said, “you’ve seen an extreme faction of the Republican Party that has shown again and again and again that they’re willing to hijack the entire party and the country and the economy and bring progress to an absolute halt if they don’t get 100 percent of what they want.”

The final days of the contest between McAuliffe, a Democrat, and his Republican opponent, Attorney General Ken Cuccinelli II, have centered on each man’s accusation that the other would bring the wrong kind of Washington politics to Virginia. McAuliffe, Republicans say, is a symbol of the Affordable Care Act and its error-filled rollout. Cuccinelli, according to his opponent, is a tea party hero whose extreme views would trump pragmatic governance.

And while McAuliffe sought to use Obama’s appearance to energize the Democratic base — particularly young and minority voters who turned out for the president last year — Cuccinelli spent much of Sunday trying to turn the visit into a liability.

Cuccinelli’s hope was for a last-minute upset of the lead McAuliffe has held in the polls for several weeks. Polls continued to show McAuliffe ahead in the race late last week, but his lead varies widely depending on the survey, and Cuccinelli said he thinks the numbers are tightening. Although Virginia supported Obama in 2008 and 2012, the state elected a Republican governor in 2009 and is still widely viewed as a state that could go either way. In off-year elections such as this one, Democrats typically struggle to turn out the sporadic voters who helped turn Virginia blue in recent presidential years.

After touching down at the Shenandoah Valley Regional Airport south of Harrisonburg, Cuccinelli called the president’s landmark legislation “the unaffordable care act” and told his fans that he was the first attorney general to challenge the law.

“I was literally the first human being in America to fight it, 30 minutes after the president signed it,” Cuccinelli said to cheers. “On Tuesday, Virginia can send them a message by electing me the next governor of Virginia.”

Cuccinelli told the crowd that Obama’s presence in Virginia would “crystallize the focus of the message of this campaign around Obamacare.” As the candidate criticized the president, one woman in the crowd shouted, “He’s a loser!”

The Republican was greeted by about 150 supporters and campaign volunteers. It was his first public stop on a tour of some of the state’s more rural and conservative areas, including Lynchburg, Roanoke and Abingdon.

During the partial shutdown of the federal government, Cuccinelli found himself stuck between his own alliance with those who helped force the shutdown and its unpopularity among the federal workers and contractors who live in Virginia. He suggested recently that the shutdown is no longer an issue in the race.

Obama said Sunday that Virginians have long memories.

President Obama spoke a rally in Arlington on Sunday for Virginia gubernatorial candidate Terry McAuliffe, who is leading in the polls over Republican Ken Cuccinelli before Tuesday's vote. (Reuters)

“If you embrace the very politics that led to this shutdown, then I guarantee you it’s not in the rearview mirror of voters in Virginia,” Obama told a crowd that the White House estimated at 1,600.

McAuliffe reinforced those themes in his remarks.

“The question in this election is simple: Will the mainstream bipartisan majority in Virginia be drowned out by the tea party?” McAuliffe said. “If mainstream Virginians from both parties don’t turn out to vote, you’re letting the tea party decide Virginia’s future.”

Both candidates are using big-name surrogates to encourage Virginians to vote.

“Nothing makes me more nervous than when my supporters start feeling too confident, so I want to put the fear of God in all of you,” Obama said in his 20-minute address.

McAuliffe has had a complex relationship with Obama and his administration. As an operative, his allegiance was elsewhere in 2008, and he remains far more closely identified with a past president (Bill Clinton) and a potential future one (Hillary Rodham Clinton) than the White House’s current occupant.

At a June candidates forum in Reston, McAuliffe was asked by a member of the audience about his “role in Chicago politics” and “your political involvement with the Obama administration” that, the man said, was “at war with private industry.”

McAuliffe, seemingly annoyed by the question, responded: “Simple answer: I’ve never served in the Obama administration. Full disclosure: I actually chaired the Hillary Clinton for president campaign. We actually ran against [Obama], but whatever.”

As a candidate, McAuliffe has neither completely embraced nor run away from Obama. He backed the federal health-care law and has advocated strongly for Virginia to expand its Medicaid program, as the law allows. But he has also acknowledged in recent days that the rollout of hasn’t worked and that the administration needs to be held responsible.

Perhaps most notably, McAuliffe — after initially declining to take a position — said he supported Environmental Protection Agency rules restricting carbon emissions for new coal- and gas-fired power plants. As a result, Cuccinelli and other Republicans have accused McAuliffe of being an accomplice in Obama’s “war on coal.”

On Sunday, Cuccinelli also took a swipe at McAuliffe’s support for expanding Medicaid in Virginia under the Affordable Care Act. He said it is “the single biggest budget decision” the next governor will have to make.

“On Tuesday, you can decide with your vote to support the Obamacare Medicaid expansion with Terry McAuliffe, or you can oppose expanding Obamacare with the Medicaid expansion by voting for me,” Cuccinelli said. “On Tuesday, we will send Washington a message: No more Obamacare in Virginia.” Cuccinelli also jabbed at McAuliffe’s “Hollywood values” and F rating from the National Rifle Association, the federal government’s deficit, the EPA (which he called “the employment prevention agency”) and the size of government.

“More government hasn’t been working out so great for us, has it?” Cuccinelli said, receiving several answers from the crowd. “They have their extremist left-wing agenda that doesn’t involve you standing on your own two feet.”

Both candidates embarked on their final campaign sprints with their down-ballot ticket mates — notably, the two men running for attorney general, who are locked in the most competitive of the three statewide races this year. McAuliffe appeared with state Sen. Mark R. Herring (Loudoun), the Democratic candidate for attorney general, while Cuccinelli stood with state Sen. Mark D. Obenshain (Harrisonburg).