Ken Cuccinelli II’s Republican friends on Capitol Hill could soon be frenemies if their threat of a federal shutdown continues.

As conservatives in the House and Senate face off with President Obama over his health-care law in a battle that threatens to shut down the federal government, Cuccinelli finds himself in a predicament in the Virginia governor’s race.

Cuccinelli became a conservative hero by challenging the health-care law, and he needs those ardent allies to carry him to victory in an uphill, off-year election against Democrat Terry McAuliffe.

“I think Ken Cuccinelli’s fortunes rise and fall on the backbone of House Republicans,” said Ronald Wilcox, an organizer with the Northern Virginia Tea Party.

But the showdown also means that Cuccinelli could alienate more middle-of-the-road voters — the folks who might not like Obamacare but dislike government dysfunction even more. That’s especially true in the Northern Virginia suburbs.

The U.S. is the only big country with a debt ceiling. The Post's Karen Tumulty explains why. (The Washington Post)

“This is not tea party country, for the most part,” former congressman Tom Davis (R-Va.) said Thursday. “To the extent that the tea party is viewed as part of the problem up here, it’s not going to help the Republican candidate.”

For Cuccinelli, the timing of the showdown is particularly troublesome. McAuliffe already holds a solid lead in several polls, and the slugfest over Obamacare and federal spending started to build right about the time that Cuccinelli had caught one of his first breaks of the race: his endorsement by the Northern Virginia Technology Council’s TechPAC.

He’s also scheduled to host Sen. Ted Cruz (R-Tex.) on the campaign trail. Cruz, a ringleader of the showdown, grabbed lots of attention this week after enlisting “Dr. Seuss” in a 21-hour filibuster-like maneuver designed to intensify the battle over Obamacare. But Cruz’s maneuver also exposed the widening split between moderates and conservatives in the GOP and prompted Democrats to demand that Cuccinelli denounce Cruz’s tactics.

“What Ken Cuccinelli needs to do is to use some of the tea party capital that he has accumulated and to tell them what a damaging impact a tea-party-led shutdown of the federal government would have on the Virginia that Ken Cuccinelli says he wants to rep­resent,” Del. Robert H. Brink (D-Arlington) said in a teleconference this week.

Cuccinelli treaded carefully around the issue during the Wednesday night debate with McAuliffe, sponsored by the Fairfax County Chamber of Commerce and NBC4.

“None of us want to see a government shutdown,” Cuccinelli said, adding that as a Northern Virginian, he knows how much the region depends on the U.S. government.

Debate moderator Chuck Todd pressed him: Did he support Cruz or not?

“I said I don’t want the federal government to shut down,” Cuccinelli responded. “I’d like to see Obamacare pulled out of federal law. But, you know, we’ve got to keep moving forward and make compromises to get the budget going.”

Cuccinelli then turned the issue back on McAuliffe’s pledge that he would not sign a budget unless it included expanding Medicaid under the Affordable Care Act.“This is a Washington tactic,” Cuccinelli said. “And if you like the way Washington works, you will like a Governor McAuliffe.”

Behind the complex maneuvering in Congress is Republicans’ attempt to kill Obamacare by withholding its funds. A recent Washington Post-ABC News poll found that Americans dislike Obamacare by 52 percent to 42 percent. But the poll also found that only 27 percent support shutting down the federal government to defund the law.

A shutdown would be felt particularly hard in Virginia, owing to its sizable population of government-dependent contractors and federal employees in Northern Virginia and its heavy military presence in Hampton Roads.

“The last time we had a shutdown, we saw a great deal of pain inflicted, but not as much as would occur this shutdown,” said Rep. Gerald E. Connolly (D-Va.). “It’s going to affect every federal agency. It’s going to affect every federal program. It’s potentially going to affect every federal contractor.”

Rep. H. Morgan Griffith (R-Va.) said it’s too soon to tell whether there will be a shutdown and even more premature to talk about its effects. The confrontation so far, he said, could be more positive than negative for Cuccinelli by contrasting his opposition to Obamacare and McAuliffe’s enthusiastic support. Especially when, Griffith claimed, many Americans are learning that Obamacare is unworkable, costly and a significant drag on the economy.

“In my district, people despise Obamacare,” Griffith said. “I think the American people know it’s a disaster, and they want out of it.”

Quentin Kidd, a professor of government at Christopher Newport University, said the showdown could benefit Cuccinelli’s campaign in some ways but also inflict harm, depending on the timing. The brinksmanship could fire up his allies, who detest Obamacare and uncontrolled federal spending and consider him as a hero for standing up for the cause. But if the fight on Capitol Hill leads to a shutdown, Cuccinelli will suffer.

“In that sense, what’s going on in Congress could help if it’s energizing the base. Because it’s reminding the base how much they hate Obamacare,” Kidd said. “But I think if the showdown goes to the point of shutting the government down, then I think there’s more negatives than positives for him.”

And that’s particularly treacherous for Cuccinelli, Kidd said, because the race had shifted his way for the first time in months after getting the TechPac’s endorsement.

“The irony is he’s been trying to tie Terry McAuliffe to Washington politics,” Kidd said. “But he would be the one tied to Washington.”

Wilcox, the tea party organizer, said he sees only benefits for Cuccinelli, who has proven his bona fides as an opponent of big government through his opposition to Obamacare, Environmental Protection Agency regulations designed to fight climate change and the transportation-funding measure backed by Gov. Robert F. McDonnell (R).

“We just had the largest tax increase in Virginia’s history, and that’s left many people gobsmacked,” Wilcox said. “Activists want to see that government will restrain itself. The only person in the race who will restrain it is Ken Cuccinelli.”