This year's Fredericksburg Fair had the usual attractions: Hercula the Giant Horse and Black Jack the Giant Steer, the carnival rides and the four-wheeler races. But added to the mix was something Virginians had not seen for decades -- the earnest campaigning of a competitive presidential race.

As the Friday-night crowds entered the fairgrounds in a part of the state on the dividing line between its liberal north and conservative south, volunteers for Sen. Barack Obama's campaign set up post to register voters. "It's time for a change," said one volunteer, Josef Jazvic, 39, an information technology worker helping on a campaign for the first time. "The fact that [Virginia] is even up for grabs tells you a lot."

Virginia hasn't voted for a Democratic presidential candidate since 1964, and President Bush carried the state twice, by nine and eight points. But the campaigns of Obama and his Republican opponent, Sen. John McCain, agree that it has become one of the nation's new swing states, joining the likes of Ohio, Florida and other battlegrounds in determining who will win the White House. The result in the Old Dominion has been a burst of political activity unlike any in modern times.

In early June, after clinching his party's nomination, Obama held his first big rally in Prince William County, the state's second most populous county and one that is critical to his chances of winning Virginia. He has since opened more than two dozen campaign offices across the state and says he has 10,000 volunteers working to deliver its 13 electoral votes.

McCain's national headquarters is in Arlington, and his campaign is trying to mobilize a conservative core that other Republicans have been able to take for granted. Both candidates are seriously considering Virginians as their running mates, perhaps the clearest sign yet that the state has presidential cachet.

"If you had told me four years ago that a Democratic presidential candidate would be running a competitive race in Virginia and would open 10 offices, I would say that is spectacular," said Gov. Timothy M. Kaine, a leading contender to be Obama's running mate. "Now we have a guy who has opened 20 to 30 offices around the state? You've got to be kidding me."

The Obama campaign believes it can win by duplicating the success of Kaine, Sen. James Webb and former governor Mark R. Warner, who have led a Democratic revival in Virginia that would be complete with a win on the presidential level. The campaign hopes to capitalize on Bush's lack of popularity, the changing demographics in Northern Virginia, high turnout -- particularly among younger voters and African Americans -- and a volunteer base that delivered a big win in the Democratic primary in February.

Virginia Republicans acknowledge that the state has become more competitive but predict that it remains inherently conservative, particularly when it comes to national security and other issues at stake in a presidential race.

"We have traditionally been the party who can get their people to the polls when it's a presidential race," said Jerry Kilgore, a former state attorney general from southwest Virginia who lost to Kaine in 2005. "Even in 1996, when [Bill] Clinton was winning every state imaginable, Bob Dole won Virginia because our people showed up."

Both campaigns have been running television ads in the state for weeks, but on the ground the battle is emerging as a contrast in approaches. In keeping with his strategy throughout the primaries, Obama has invested heavily in field operations, opening 28 offices -- including one in tiny Castlewood, in the farthest southwest corner -- and deploying dozens of paid staffers and "fellows," volunteers recruited from around the country.

His campaign is also relying on native Virginian volunteers -- delegating team leaders in each of the state's 2,600 precincts and encouraging them to organize events, all of which are advertised on the interactive "My Barack Obama" portion of the campaign's Web site.

In Northern Virginia the week of July 21, volunteers ran a nightly phone bank out of offices in Arlington and McLean. They also registered voters at Wolf Trap concerts, movie theaters, grocery stores and a farmer's market. They sent out hundreds of canvassers in the evenings and on weekends, held a house party in Fairfax for the Jewish community, and held issue discussions at restaurants in Arlington and Alexandria.