Before he takes the stage in Baltimore to formally declare his bid for governor Wednesday evening, Mayor Martin O'Malley (D) will spend the bulk of the day campaigning in the Washington suburbs, putting in high-profile appearances in both Montgomery and Prince George's counties.

The mayor's whirlwind itinerary is testament to a serious shift in Maryland's political landscape -- and underscores the respective challenges he and Montgomery County Executive Douglas M. Duncan face as the 2006 governor's race gets underway in earnest.

O'Malley is striving to become better known in a region with newfound clout in Democratic primaries, while Duncan must find a way to break into Baltimore's expansive media market to be competitive.

Unlike two decades ago, when William Donald Schaefer made the leap from Baltimore to Annapolis, being a popular mayor of Maryland's largest city is no longer enough to guarantee the Democratic gubernatorial nomination. Since 1986, the share of Democrats residing in Baltimore and surrounding Baltimore County has waned while Montgomery and Prince George's have grown into the state's most Democrat-rich counties.

"The axis has shifted towards the greater Washington marketplace," said Keith Haller, an independent Maryland pollster. "Especially for the Democratic primary, that is where the attention will be focused."

Nearly one-quarter of Maryland's registered Democrats resided in Baltimore when Schaefer was first elected governor; today, fewer than 15 percent do. The share of Democrats in Baltimore County also has dipped, to about 15 percent. Meanwhile, Montgomery and Prince's George's together account for more than 35 percent of the state's registered Democrats.

While the dynamic should help Duncan's chances, he will enter the race confronting arguably more immense challenges than O'Malley -- which are reflected in early primary polling that show the mayor with a double-digit lead statewide.

Despite a summer-long "listening and learning tour" that has taken him to all corners of the state, Duncan remains a virtual unknown in the Baltimore media market. Baltimore television stretches well beyond the city limits, reaching more than half the state's registered Democrats, including much of the Eastern Shore.

Mike Morrill, a longtime Maryland Democratic operative who has worked for Sen. Barbara A. Mikulski and former governor Parris N. Glendening, said, "People have already formed impressions of the mayor in large parts of the state where Doug is a complete blank slate. It is very difficult for Washington suburban candidates to get media coverage in the Baltimore area and very difficult for them to penetrate the consciousness up here."

That was apparent Friday afternoon, when Duncan's tour took him to Chesapeake City in the northeastern corner of the state. The head of valet parking at an inn where he stopped had never heard of him. Over soda and hors d'oeuvres at the inn, Duncan, who plans to make his bid official this fall, chatted with five Democrats about ways to get better known in Cecil County.

It is territory where O'Malley has quite a profile. Not only do residents see the mayor on TV, but his Irish rock band has made regular appearances at an outdoor stage near the inn.

"His opponent used to come down here and play in the band, so everyone knows him," said Bill Manlove, a county commissioner who is backing Duncan. Asked how Duncan can boost his exposure, Manlove paused and then said: "People are starting to talk a little bit. They ask me what I think of him."

Aides to Duncan said that intense media coverage of the race will turn him into a household name long before votes are cast in the September primary and that the more important task for now is locking down support of party activists such as those who attended Friday's meeting. Still, some analysts said breaking into unfamiliar territory can be very difficult.

"You tend to vote for a candidate you feel you know in a primary," said Thomas F. Schaller, a political science professor at the University of Maryland Baltimore County, who is active in Maryland politics and supports O'Malley. "Region isn't the only thing, but it certainly matters."

On a recent weekday afternoon, O'Malley emerged from an IHOP in the Prince George's town of Forestville, where he had just finished meeting with about 30 Democratic activists and elected officials.

Part of the group headed across the street to a strip mall, where O'Malley was led on a tour by state Sen. Ulysses S. Currie (D-Prince George's). A woman working at Bath & Body Works asked for a picture with the mayor, and others gawked at his entourage. But many of the shoppers clearly had no idea who O'Malley was.

"One day he might run for governor, but he'll let you know that," Currie playfully told a group of teenagers they encountered.

O'Malley has quietly been making such visits to Prince George's weekly, according to campaign aides, as he tries to strengthen his ties in a county also crucial to Duncan's chances of success. The mayor has another foray scheduled today in Greenbelt.

O'Malley has not shied away from campaigning in Duncan's home county, either. Though he rarely mentioned it during his rise to power in Baltimore, O'Malley grew up in Montgomery County, and his parents still live there. A press advisory for Wednesday's announcement tour refers to Rockville as his "hometown."

Analysts said that O'Malley's challenge there -- and elsewhere in the relatively affluent Washington region -- will be to convince voters that his stewardship of a city struggling with violence and drug addiction merits a promotion to governor. His speeches are filled with statistics pointing to progress.

Duncan, in some respects, faces the opposite challenge in the Baltimore region. Once he gets his name into circulation, he will have to overcome the stigma that appears to attach itself to all statewide candidates from Montgomery County.

"They used to say Montgomery County's streets are paved in gold," said Stanton Gildenhorn, a former chairman of the county's Democratic Central Commission and a Duncan supporter. "You had to figure out how to persuade people that, coming from here, you could still understand their problems."

Duncan's initial effort to combat perceptions of wealth and privilege has involved recounting his personal story. He tells prospective voters how he grew up one of 13 children, whose father taught non-English-speaking students in the public schools, and whose mother worked 27 years in the county courthouse.

His Web site says he grew up in the Twinbrook section of Rockville, "a working-class neighborhood, home to federal employees, teachers, police officers and firefighters." He often reminds people that he graduated from college in three years so his parents could afford to send the next sibling off to college, and that his oldest son has joined the military.

Gildenhorn said he believes Duncan's advantage in the race is that it will be less expensive for him to share that story with voters on Baltimore television than it will be for O'Malley in the more expensive Washington market, which reaches the homes of about 45 percent of Maryland Democrats. (Viewers in Anne Arundel and Howard counties can watch stations in both markets but are considered part of the Baltimore market.)

Organizations that sway large blocs of voters in Baltimore, such as labor unions and religious groups, also are more accessible to candidates from other parts of the state. It was largely through those organizations that Glendening, a former Prince George's county executive, was able to break out of the Washington suburbs and capture the Democratic nomination in 1994.

Duncan has been concentrating his initial efforts in Baltimore on these constituencies. Saturday morning, he attended an awards breakfast for African American women with Sen. Delores G. Kelley (D-Baltimore County).

But even with such groups, Sen. Lisa Gladden (D-Baltimore) said she believes O'Malley has an edge.

"Martin has been working with these community groups and these informal leaders in Baltimore City for six or seven years," she said. "And where Martin can use his position as mayor to keep those groups satisfied and tend to their extraordinarily varied needs, Doug can only offer hope for what he might do if he became governor."

For now, Duncan's challenge is even more fundamental, she said. "They just haven't heard of him," Gladden said of her constituents. "It's not that they might not like him when they got to know him. But he's not going to get votes unless people know who he is."

Baltimore Mayor Martin O'Malley is making frequent appearances in Prince George's and Montgomery counties.