When J. Frank Raley Jr. first ran for the state legislature from St. Mary's County, he encountered two types of voters -- liberal Democrat and conservative Democrat.

Republicans were scarce throughout Southern Maryland, and there was little need to worry about facing a Republican opponent. "When you did," Raley said, "you didn't even care, because they didn't have a chance."

He represented St. Mary's in the State House in the 1950s and '60s, but the Democratic domination continued well into the past decade.

Those days are gone. Now, Republicans have narrowed the gap to within 1,600 registered voters in St. Mary's, and have slightly surpassed registered Democrats in neighboring Calvert County.

"This is red country," said Raley, who at 79 is an elder statesman of the local Democratic Party.

Registered Republicans are still vastly outnumbered in Southern Maryland's most populous county, Charles, where many new residents have arrived from one of the state's Democratic strongholds: Prince George's County.

But there are signs that even Charles is in play. As with its smaller neighbors, Charles helped Robert L. Ehrlich Jr. become Maryland's first Republican governor in a generation in 2002. He carried all three counties.

After Ehrlich's victory, Democrats realized that they could no longer rely on winning with just the Big Three liberal jurisdictions of Baltimore and Prince George's and Montgomery counties. As a result, the two Democrats vying to challenge Ehrlich next fall are spending a lot more time in Maryland's far-flung exurbs.

"There is no such thing as a spare county," Baltimore Mayor Martin O'Malley said last week, popping bite-size crab cakes into his mouth on the dock of a Broomes Island seafood joint on the Patuxent River. "We are going to contest this election in every county.''

His likely rival for the nomination, Montgomery County Executive Douglas M. Duncan, last week completed a statewide county-by-county tour that included stops at the Patuxent River Naval Air Station and an outdoor concert at St. Mary's College.

Southern Maryland's population is still dwarfed by the Big Three's, accounting for 5.6 percent of the state's 3 million voters. But it is the state's fastest-growing region, and Maryland pollster Patrick E. Gonzales said it has increasing importance.

"This is the future of the state," he said. "You go to those areas to make your case."

Converting visits into votes in general election contests for governor and U.S. Senate may prove difficult for Democrats. Longtime residents and elected officials -- past and present -- say state and national party leaders are often out of touch with Southern Maryland's brand of fiscally conservative and socially moderate Democrats.

"They've left us behind," said Democratic Del. John F. Wood Jr., a retired grocer from St. Mary's County who is often at odds with party leaders in Annapolis on taxes, the minimum wage and abortion. "The Democratic Party is not on the same wavelength as people in rural areas."

Southern Maryland echoes regional and national patterns from recent presidential elections showing that the farther voters lived from urban areas, the more likely they were to favor the Republican candidate.

The change in the past decade is perhaps more pronounced because it has coincided with a 66 percent increase in population at the Navy base, from about 12,000 in 1993 to 20,000 this year. Naval installations in the three counties employ 26,000 people, providing nearly one in three jobs, according to an analysis by the Tri-County Council for Southern Maryland.

The arrival of military families and defense contractors to support the base has created a deep pool of Republican voters, said Zach Messitte, director of the Center for the Study of Democracy at St. Mary's College.

In St. Mary's, about 30 miles south of the Capital Beltway, Republicans have closed the voter-registration gap to 3 percentage points, compared with a Democratic edge of 26 percentage points in 1992.

In neighboring Calvert County, Republicans narrowly captured a greater percentage of voter registration in 2003 for the first time in more than 30 years and are holding on to a lead of less than 1 percentage point.

In Charles, Republicans are behind 35 percent to 49 percent. That hasn't stopped Lt. Gov. Michael S. Steele (R) from courting black community leaders in the county as he explores a bid for retiring Democratic Sen. Paul S. Sarbanes's seat.

When the Navy brought Montgomery County native Dave Spigler to Southern Maryland in 1979, Democrats outnumbered Republicans by more than 30 percentage points in Calvert County, and he fit in as a Reagan Democrat.

Then, he was a military man trained to be apolitical. But as the once-rural county began to grow around his secluded Lusby subdivision with a view of the Chesapeake Bay, Spigler asked himself, "Why am I holding on to my Democratic affiliation?''

Four years ago, Spigler switched parties. On national issues, the 22-year veteran and 60-year-old father of a Marine said he trusted Republicans more on national security. Locally, he said, the GOP seemed better suited to deal with what he described as "too many people too quickly."

Republicans, he said, "will keep life in Southern Maryland the way we remember it."

St. Mary's County commissioners President Thomas F. McKay, another recent convert to the GOP, said Democrats have moved too far away from traditional southern values of small government, individual responsibility, family and religion.

The ability of local Democrats to influence voter registration is further hindered by national perceptions about the two parties, said Kevin Igoe, a Republican consultant who lives in Calvert. Howard Dean's elevation to chairman of the Democratic National Committee, he said, was not helpful.

"When you attack the Republican Party as being a party of white Christians, a lot of people look at themselves and say, 'Aren't I a white Christian?' " he said, referring to controversial comments Dean made in June

Del. John L. Bohanan Jr. (D-St. Mary's), district director for Rep. Steny H. Hoyer (D), acknowledged that the party "has a lot of work to do to make sure that new arriving residents recognize the traditional roots" of the party in Southern Maryland.

But Bohanan said he is also interested in the people who are choosing not to affiliate with either party, a group that has nearly doubled as a percentage of registered voters in his county since 1992.

Martin Fairclough, executive director of the nonprofit Patuxent Partnership, moved to the area a decade ago and counts himself among the independents. He does not subscribe to the view that because St. Mary's is a military town, people are automatically Republicans.

"You've got the Navy wives and husbands who simply vote Republican, period, end of story," he said. "But once people become part of the fabric of the community, it comes down to the individual" candidate.

During one of Duncan's visits to St. Mary's, Wood said he pulled him aside to share the county's perceptions. "I like Doug a lot, but I told him, 'People in Montgomery County have never seen a tax they don't like,' " Wood recalled. " 'Down here, we don't think like that.' "

Duncan responded, " 'That's not right,' " Wood said. "But that is right."

For both Duncan and O'Malley, he said, "It's not going to be easy."

Chris Reynolds, Calvert County Democratic chairman, hands out stickers at the county fair. Republicans now outnumber Democrats in the county.

Republican Frank McCabe fills balloons at the Calvert County Fair in September. The party is getting stronger across Southern Maryland.