Republican Charlie Baker has edged ahead of Democrat Martha Coakley in the race for governor, taking the lead by the slimmest of margins for the first time in the Globe's weekly poll.
The survey found the hypothetical general election race in a statistical dead heat, with 38 percent of respondents saying they would support Baker for governor, a slight edge over the 37 percent who said they favor Coakley. Though Baker's lead remains well within the margin of error, it shows movement in a race between the two likeliest candidates for the November election.
Coakley still faces two Democratic rivals in the Sept. 9 party primary, but the poll found she maintains a solid lead, claiming the support of 46 percent of likely voters. Comparatively, 24 percent support Steve Grossman, the state treasurer, and 10 percent back health care expert Donald Berwick.
The race to succeed Coakley as attorney general remains the primary season's hottest, with Warren Tolman and Maura Healey deadlocked in their fight for the Democratic nomination at 30 percent each. Meanwhile, the crowded races for lieutenant governor and treasurer are dominated by undecided voters, at 74 percent and 60 percent, respectively, the poll found.
Those three contests "are anybody's to win," said John Della Volpe, chief executive of SocialSphere Inc., which conducted the survey for the Globe. "It's surprising to me that you still have so many undecideds in each of those three races and I'm sure incredibly frustrating to each of those campaigns."
The live survey of 605 likely voters, conducted Aug. 17-19 and Aug. 24-26, has a margin of error of 4 percentage points for the total sample. The Democratic primary match-up has a margin of error of 5.2 points.
The numbers moved very little between the first and second weeks of the two-phase survey, even as the primary election drew closer. Races often tighten in the final weeks, as advertising picks up, voters tune in, and lesser-known candidates begin to draw attention.
The last Globe poll, taken Aug. 10-12 and Aug. 17-19, found Coakley leading Baker by 7 points.
The bump for Baker follows advertising by a super PAC backed by the Republican Governors Association, which began airing TV ads highlighting Baker's experience as a top aide to former governor William F. Weld and as president and chief executive officer of Harvard Pilgrim Health Care.
Della Volpe also noted that Baker has put some distance between himself and a self-inflicted controversy last month over the Supreme Court's "Hobby Lobby" ruling, which allowed some employers to limit contraceptive insurance coverage. When Baker said his personal view of the ruling did not matter, Democrats suggested he was minimizing the significance of the ruling to women.
The latest poll data shows Baker's favorability rising slightly among voters. Forty-seven percent of respondents say they have a favorable view of him — up from 41 percent in the first two weeks of August — while his unfavorable rating of 22 percent held steady.
Conversely, Coakley's favorable rating dipped two points to 51 percent in that time span, while her unfavorable rating climbed to 40 percent.
In addition, the poll shows Baker picking up general election support from an unlikely base: Grossman's backers.
If Grossman loses the primary, 48 percent of his supporters say they would bolt the party and vote for the Republican, rather than Coakley, in the general election. Just 28 percent of Grossman's supporters would vote for Coakley, Della Volpe said.
Conversely, if Coakley loses the primary to Grossman, the majority of her supporters — 56 percent — say they would support Grossman as the Democratic nominee, while 18 percent would turn to Baker, the poll showed.
"The Grossman voters really don't like Martha Coakley," Della Volpe said. "As [the primary election] is getting closer, as differences are being sharpened between the [Grossman and Coakley] campaigns, the Grossman voters are liking Martha Coakley even less."
As the frontrunner throughout the Democratic primary race, Coakley has been taking most of the heat from her rivals, facing attack ads from super PACs supporting Grossman and now Baker. On Thursday, the Commonwealth Future Independent Expenditure Political Action Committee, the same group that had been airing the positive ads for Baker, launched a new TV spot on Fox channels mocking Coakley for being unable to pinpoint the rate of the gas tax while supporting its automatic increase.
Even if Coakley emerges from the primary as the Democratic nominee, Della Volpe said, it makes sense for the opposition to try to weaken her for the general election.
"They're trying to take her and her campaigns's eye off the ball of what she needs to do," he said.
Coakley continues to dominate among female voters in a matchup against Baker, with the results showing a near mirror image based on gender. Men favor Baker over Coakley 48 percent to 29 percent, while women prefer Coakley to Baker 44 percent to 29 percent, according to the latest poll, Della Volpe said.
However, the duel for attorney general revealed no real gender gap, he said.
Healey's slim, three-point lead, is on the border of being statistically significant, he said.
"It's an opportunity for her," Della Volpe said. "But I would give the Tolman campaign credit for starting so strong with that first ad based on protecting women [and rights to access abortion clinics]."
Della Volpe said analysts should keep an eye on Tolman's support from women after this week's controversy over a debate, in which Tolman called Healey's aggressive line of questioning "unbecoming." Women's political groups and supporters launched a social media campaign criticizing the remark, which they deemed sexist, and seized upon it in a fund-raising plea.
Forty percent of voters reported they remain undecided in the race for attorney general, however.
The Democratic primary for lieutenant governor, in which 74 percent remain undecided, is led by Steve Kerrigan at 14 percent, followed by Mike Lake at 7 percent and Leland Cheung at 5 percent.
In the Democratic primary race for treasurer, Barry Finegold leads with 17 percent, followed by Deborah Goldberg at 14 percent and Thomas Conroy at 9 percent. Sixty percent of respondents remain undecided.
In the governor’s race, Baker faces Republican Mark Fisher in the Republican primary Sept. 9. The winners of the major-party primaries will then face three independent candidates for governor in the general election: Evan Falchuk, Jeff McCormick, and Scott Lively.
Globe Staff Writer David Scharfenberg contributed to this report. Stephanie Ebbert can be reached at Stephanie.Ebbert@globe.com. Follow her on Twitter @StephanieEbbert.