Barack Obama stunned Virginia Republicans when he won the state in 2008, the first Democrat in 44 years to carry the commonwealth in a presidential election.

Winning historically conservative Loudoun County was a crucial piece of Obama’s Virginia victory, and Republicans in Loudoun want to make sure he doesn’t repeat that success in 2012.

State and local political officials believe that Loudoun — with a fast-growing population that is generally wealthy, well educated and increasingly diverse — could be one of the pivot points in this year’s election. With about 300,000 residents, Loudoun has fewer voters than its suburban neighbors. But solidifying Republican control of the county would provide the GOP with a valuable counterweight to more consistently Democratic jurisdictions elsewhere in Northern Virginia.

Preventing a repeat of 2008 is a big goal, but the Republican Party’s efforts to achieve it started small, beginning months ago with an intensely local campaign strategy.

In November, Republican candidates swept the Loudoun County Board of Supervisors, marking the first time in nearly 20 years that all nine seats on the board were held by the GOP.

The winning campaigns were bolstered in part by an unusual infusion of financial support from the Republican Party of Virginia, which made Loudoun’s local races part of a statewide effort aimed at securing Republican victories in General Assembly races.

It was a remarkable gain for the GOP, albeit one in which several of the supervisors’ races were won by narrow margins. Indeed, as presidential and U.S. Senate votes near, Loudoun Republicans know that Democrats remain a competitive force.

The GOP’s determination to entrench Republican control of county politics was evident at a recent meeting of the Loudoun County Republican Committee, where a crowd of hundreds filled the board room of the county government center in Leesburg to hear candidates and party leaders speak.

Susan Allen, wife of Republican Senate hopeful and former governor George Allen, was among the first at the lectern. She stood flanked by her husband’s campaign posters, each emblazoned with a solid-red icon in the shape of the commonwealth.

“You did stellar work this past November,” Susan Allen told the standing-room crowd, which answered with vigorous applause. “We want to build on that. . . . This is a movement that is taking place that needs to continue for the next nine months.”

She made a prediction: Virginia will be the deciding factor in the national election.

“We want to make sure that the great American comeback starts right here in Loudoun County, in the commonwealth of Virginia,” she said. The audience cheered and whistled.

If a Republican comeback starts in Loudoun, it will be based out of a three-room office, tucked away on a quiet side street in downtown Leesburg.

The headquarters of the Virginia 10th Congressional District Republican Committee may be small, but it proved mighty in the 2011 elections: Of the 34 candidates endorsed and supported by the office, 32 won, according to party officials.

Loudoun sits at the heart of the 10th District, which includes parts of Fairfax and Prince William counties and stretches west into Clarke, Fauquier, Frederick and Warren counties.

It was a pivotal territory in 2008, according to Howie Lind, 10th District GOP chairman. “We realized that we had to win the 10th District to really win Virginia for the presidential nominee” in 2012, he said.

But first, the stage had to be set.

“If you’re going to make big changes, you have to start at the bottom and work your way to the top,” said Dianne Mayersak, a member of the Loudoun County Republican Women’s Club.

The Republican Party of Virginia agreed and spent more than $60,000 — a sizable sum in county supervisor races, where most campaigns can expect to receive about $100,000 in donations — to sponsor mailings and campaign literature for five Republican candidates, according to Virginia Public Access Project records. It was an exceedingly rare investment for the state party, which generally stays out of county races, according to Garren Shipley, a Republican spokesman.

No similar contributions were made by the state Republican Party in recent local elections in Loudoun, according to VPAP records. But last year Republicans implemented a “total ticket” strategy that included support for county-level candidates, according to David Rexrode, executive director of the Republican Party of Virginia.

“Loudoun is an important county for us, it always is, and we did want to focus on it,” Rexrode said.

During the more than 200,000 calls made to Loudoun voters, volunteers asked whom residents were supporting not only in the state races but in the supervisors contests, Rexrode said. “Our goal was to help all of our Republican candidates across the board.”

Rexrode noted that Loudoun’s neighboring counties in Northern Virginia, including Fairfax and Prince William, also are important battlegrounds, and they have considerably larger populations.

But the party was less focused on local elections in those areas because those jurisdictions are more challenging for the GOP, said Mark Sell, chairman of the Loudoun County Republican Committee.

“Places like Arlington and Fairfax are tough for Republicans,” he said. “Loudoun County is an opportunity for us to offset some of what happens in those areas. . . . We are a growing county and therefore of more importance. If you want to win Virginia, whether it’s for statewide office or whether it’s for president, you need the most votes, and this is a vote-rich area.”

Local Democrats agree that Loudoun’s exponential growth has made it a more valuable political target. But Evan Macbeth, new chairman of the Loudoun County Democratic Committee, said the county’s soaring population of racially diverse, well-educated and younger voters is a boon to Democrats.

“This is a remarkably diverse county now,” Macbeth said. “It is a reflection of a lot of the changes that America has gone through over the past 20 years, and I think those are the reasons that it’s being so aggressively targeted.”

Although the county has historically been a Republican stronghold, Macbeth said Democrats are gaining traction.

“There’s an interesting fact about Loudoun County — when more people vote, Democrats win,” he said. “What happened last fall is fewer people voted.”

Recent election records appear to support that theory: The new, all-Republican board was elected by 28 percent of Loudoun’s registered voters, compared with a turnout of about 34 percent in 2007, when county voters elected five Democratic, two independent and two Republican supervisors, according to county reports.

Unlike the Republican Party of Virginia, the state Democratic Party made no investments in last year’s board races. But Macbeth said the party’s national campaign efforts are underway.

Four chapters of Obama for America are actively working in Loudoun, and hundreds of volunteers are hosting weekly phone banks, knocking on doors and conducting an “aggressive voter registration campaign,” Macbeth said.

He said Democrats will focus on reaching Loudoun’s rising number of young voters, a heavily courted demographic that proved to be a deciding factor in 2008, when Obama was supported by a majority of adults aged 18 to 29. The number of adults aged 20 to 24 in Loudoun nearly doubled between 2000 and 2010, according to census records.

“We Democrats focus on courting young voters all the time,” Macbeth said. “That’s why we win them when they vote.”

Republicans say they, too, are keeping in touch with Loudoun’s younger voters. GOP officials noted the army of student volunteers from Loudoun-based Patrick Henry College, a private, Christian school in Purcellville, who went door-to-door across the county in the fall. Teen volunteers — like Alexander Butler, a home-schooled 14-year-old who founded the Northern Virginia Teen Republican Committee in November — also helped with local campaigns, they said.

Lind, the 10th District chairman, said the GOP is gearing up for the long haul.

“Loudoun is critical for either party to win this year,” Lind said. “It’s a big deal.”