A dozen years ago, Fairfax County was the partisan battle line in Virginia. Republicans won the more distant suburbs to the west and south, and Democrats generated huge margins in Arlington and Alexandria. But in 2008 and again in 2012, that line shifted to Prince William and Loudoun counties, with Barack Obama winning both each time.

Now Stafford and Spotsylvania counties, more distant parts of the ever-expanding Washington suburbs, seem destined to be the next frontier.

This has to be a deeply troubling trend for Virginia Republicans: The party is losing its once-large margins in many suburban counties around the commonwealth. With huge Democratic electorates in the state’s population centers, Republicans have historically relied on sizable suburban victories — coupled with large majorities in the state’s rural areas — to win statewide. But the GOP margins in the suburbs are eroding.

Stafford and Spotsylvania are the two most populous Virginia counties in Washington’s outer-ring suburbs that were carried by Mitt Romney. But Romney did not win them by much. President Obama received about 45 percent of the vote in Stafford and 43 percent in Spotsylvania; Al Gore won 37 and 38 percent, respectively, in 2000.

The aggressive Democratic get-out-the-vote efforts of recent years may explain some of these narrowing margins. After all, the Democrats did not really focus on Virginia’s electoral college votes until four years ago. Keep in mind, though, that Republicans also are working these counties to a much greater extent than they once did.

The counties are following a familiar pattern: As these distant suburbs have become less rural in character, they have become less Republican. The early round of suburbanization, including many ranch homes on large tracts, has given way to large townhouse complexes near major highways and clustered around Virginia Railway Express stops.

These two waves of suburban settlers tend to have different politics. The first migrants generally are older and more politically conservative, often seeking a more bucolic lifestyle. They are followed by younger migrants who are less likely to be able to afford a single-family home on an acre or more. Many do not even want such a spread. These later arrivals mainly want to live closer to work and are younger, more ethnically diverse and more Democratic in their partisan loyalties.

These changing suburban voting and residential patterns are not limited to the Washington area. Democrats used to struggle to get 45 percent of the vote in Henrico County, which surrounds Richmond. This year, Obama won Henrico with 55 percent of the vote. Obama did about as well in Albemarle County, which surrounds Charlottesville and was also once reliably Republican.

In Chesterfield, one of the state’s most conservative large counties, Obama received 45 percent of the vote, more than 10 percentage points above Gore’s total. Virginia Beach also went for Romney, but Obama’s 48 percent showing there was well above Gore’s 41.6 percent.

Indeed, the majority of the counties in the eastern half of the state have become less Republican over the past dozen years. Even though Republicans continue to carry many of these suburban and rural jurisdictions, the narrower margins are swamped by Democratic votes in the cities and close-in suburbs. (Republicans are increasing their vote share in many of the state’s western counties, but the votes in those sparsely populated jurisdictions can’t replace what the GOP is losing elsewhere.)

Nearly a year ago, Gov. Robert F. McDonnell warned his GOP colleagues in Richmond against legislative extremism. They ignored his advice and spent time last winter talking about transvaginal ultrasounds for women seeking abortions, thus irritating many suburban voters. In the wake of this year’s suburban vote declines, Republican state legislators might now see the wisdom of the governor’s advice.

If they don’t want Virginia to change from purple to blue, Republicans need to develop far more effective strategies to connect with these newer, younger outer-ring suburban dwellers. Another round of socially conservative lawmaking in Richmond this winter will not help the GOP win the governor’s race in 2013 or return the state’s electoral votes to the GOP in 2016.

Stephen J. Farnsworth is a professor of political science and international affairs and director of the Center for Leadership and Media Studies at the University of Mary Washington in Fredericksburg. Stephen P. Hanna is a professor of geography at UMW.