The survey indicates that a majority of Maryland voters are pleased with the leadership of their Republican governor at a time when President Bush's approval rating hovers at an all-time low. Yet voters give higher marks to Democrats when asked which party they trust to tackle the state's problems.
With four months to go until the Nov. 7 election, O'Malley leads Ehrlich 46 percent to 38 percent, with 16 percent of voters undecided, according to the poll of 1,200 likely voters interviewed July 6-10. The survey, which had a margin of error of plus or minus 2.8 percentage points, was conducted by Potomac Inc., an independent Bethesda-based polling company. The last Sun survey, released in November, showed O'Malley ahead by 15 percentage points.
Ehrlich's job approval rating is 55 percent statewide, while 36 percent disapprove of how he is doing his job and 10 percent say they are unsure. In November, 50 percent of voters approved of the governor's performance.
In contrast, six in 10 Marylanders say they disapprove of the job Bush is doing.
Potomac Inc. President Keith Haller said he sees shadows of the 2002 gubernatorial contest in the latest results.
"We're seeing this divide again - call it Maryland's political divide," Haller said. "This election is up for grabs."
O'Malley holds big leads in Baltimore, Montgomery County and Prince George's County, liberal strongholds that have in the past carried Democrats to victory.
Support for Ehrlich - who is seeking to become the first Maryland Republican governor returned to office since Theodore R. McKeldin in 1954 - is concentrated in Anne Arundel County and the state's more rural areas.
Four years ago, the governor built a win on support from suburban and rural counties, and the poll shows that - compared with the November survey - he is regaining momentum in those areas.
The race is most competitive in Baltimore County, from which Ehrlich hails, the survey shows. The governor, whose boyhood home is in Arbutus and whose parents still live there, holds a 4-percentage-point lead in the county over O'Malley.
In 2002, Ehrlich pummeled Democrat Kathleen Kennedy Townsend in Baltimore County, with his victory margin there making up nearly his entire statewide edge.
This year, O'Malley and his running mate, Del. Anthony G. Brown of Prince George's County, are showing strength in the predominantly Democratic city of Baltimore, carrying 67 percent of the likely vote over Ehrlich's 16 percent. O'Malley is also ahead of Ehrlich in Montgomery County, 55 percent to 28 percent. The mayor leads in Prince George's County, 62 percent to 19 percent.
O'Malley no longer faces a primary challenge from Montgomery County Executive Douglas M. Duncan, who withdrew from the race last month after receiving a diagnosis of clinical depression. O'Malley had led Duncan in polls, and the county executive had struggled to expand his base beyond the state's most populous jurisdiction.
Meanwhile, Ehrlich, who is running with state Disabilities Secretary Kristen Cox, has a 50 percent to 37 percent lead in Anne Arundel County. Howard County is split, 45 percent for Ehrlich to 42 percent for O'Malley.
The poll's margin of error rises for smaller subgroups, such as counties.
O'Malley and Ehrlich are drawing loyal support from their respective parties, leaving the race to be decided largely by those with loose ideological ties.
Nearly one out of every two voters who describe themselves as "moderate" favor O'Malley, the poll shows. The mayor is supported by 47 percent of moderate voters; 34 percent back Ehrlich.