U.S. Republican Presidential candidate Mitt Romney speaks at an election rally alongside Virginia Governor Bob McDonnell in Sterling, Va. in June. (JASON REED/REUTERS)

For months, Republicans stood on the sidelines as President Obama gradually ramped up his reelection campaign in battleground Virginia.

Not anymore.

After a pair of recent visits by the presumptive nominee Mitt Romney , Republicans angling to win back the White House have opened a dozen campaign offices across the state.

“We are not finished investing in Virginia,’’ said Pete Snyder, chairman of the GOP’s coordinated campaign in the commonwealth to elect Republicans up and down the ticket. “Our base is fired up.”

While Democrats have made a splashy entrance in Virginia with fundraisers, well-attended rallies and plenty of headlines, Republicans have been much more low-key. The party has worked behind the scenes, with almost no interest in touting its strategy to deny Obama a repeat victory here.

“We fully expect this to be hotly contested, with the two teams battling it out, but we have the enthusiasm on the ground,” said Brian Moran, chairman of the Democratic Party of Virginia. Obama is scheduled to make a campaign swing through the state on Friday and Saturday.

Neither presidential campaign would speak publicly about its strategy in Virginia but privately both pledged to outperform the other in door-knocking, phone calls and voter registration as they vie for 13 Electoral College votes.

Both campaigns have paid staff in most regions of the state. Obama’s campaign already has 40 field organizers and nearly 20 offices. Meanwhile, the Romney camp has more than 20 branches, raised $200,000 in the state since the Supreme Court upheld the Obama health-care law, and registered voters and recruited volunteers at nearly 30 events statewide on July Fourth.

Democrats expect to surpass their party’s efforts in 2008, when they masterminded what many consider to be the state’s most comprehensive political organization in modern history. Republicans plan to triple their contacts to potential voters from their all-time high in 2009 — 2.5 million calls and 500,000 knocks on doors — when Robert F. McDonnell handily won the governorship.

Recent polls show Obama with a slight lead in Virginia, although most surveys rely on data that predate Romney’s clinching of the GOP nomination. A Washington Post poll in May had Obama ahead of Romney, 51 percent to 44 percent, among registered state voters.

Political observers think that Obama could win the general election without carrying Virginia but that the state is crucial for Romney.

Bob Holsworth, a commentator and former political science professor at Virginia Commonwealth University, said state Republicans grumbled for weeks that Romney’s campaign infrastructure lagged in Virginia. The office openings, he said, would help alleviate those concerns.

In 2008, Obama became the first Democratic presidential candidate to carry Virginia in 44 years. But since then, Democrats have lost ground to Republicans, who won statewide elections in 2009, a commanding majority of Virginia’s congressional delegation in 2010 and the state Senate in 2011.

This year, Virginia is expected to play a role in determining who occupies the White House as well as which party controls the U.S. Senate, with Republican George Allen and Democrat Timothy M. Kaine competing in one of the nation’s most-watched races. Already, the four campaigns or their supporters have flooded the airwaves with ads.

The Obama campaign has opened 17 offices in the past year, while Romney’s campaign has 23 offices, including nine that McDonnell’s political action committee maintained after his election.

Both campaigns overlap in key areas: Northern Virginia, Hampton Roads, Richmond and Southside as well as Fredericksburg and Charlottesville. And both plan to open more offices.

Obama has also claimed spaces in Suffolk and Petersburg, which have high concentrations of African Americans, while Romney has offices in the Shenandoah Valley and Abingdon near the Tennessee border.

Robert Denton, a Virginia Tech professor who specializes in political communication and campaigns, said Obama and Romney are still looking to turn out their base in areas where they know they will do well. Later in the year, perhaps after Labor Day, both candidates will aim to bring down the vote margins for their opponent in specific regions.

Democrats have expanded their footprint over the years in Northern Virginia, while Republicans have done better in the Shenandoah Valley and rural Southside and southwestern Virginia.

The state’s key battleground areas in the fall will be the outer suburbs of Washington, including Prince William and Loudoun counties; Hampton Roads, the sprawling region in southeastern Virginia that’s home to a large number of veterans, college students and African Americans; and suburban Richmond.

Republicans refuse to concede Northern Virginia, home to one of every three voters. Romney has seven offices in the region, including its headquarters in deep-blue Arlington County.

Democrats are attempting to pick up votes in Southside, an economically distressed region that Sen. Mark R. Warner (D) successfully courted in his 2001 gubernatorial election and that Obama remained competitive in four years ago. U.S. Agriculture Secretary Tom Vilsack and former Virginia congressman Tom Perriello toured Southside last month on behalf of the Obama campaign.

In recent weeks, Obama rallied supporters in Richmond — his state campaign headquarters — and first lady Michelle Obama campaigned for her husband in Prince William. Romney, meanwhile, visited Salem, outside Roanoke, and Portsmouth, and he has twice traveled through Northern Virginia.

Four years ago, neither party was heavily invested in the state by July. Obama eventually opened nearly 50 offices, even in sparsely populated regions, dispatched more than 250 paid staffers and recruited thousands of volunteers to knock on doors across the state.

But this time, the president’s campaign has had a state staff for more than two years and has held scores of events, including some focusing on women and college students. Republicans, who have had offices since 2009, are banking on a renewed enthusiasm since the Supreme Court decision on health care.

“We have had weeks in June that seem like weeks in October,’’ Holsworth said. “It’s almost in full swing.’’