The Democratic race for attorney general may be Massachusetts' second most closely watched contest in the Sept. 9 primary, with candidates Warren Tolman and Maura Healey agreeing on many topics while scrambling to distinguish themselves to voters.

Tolman has the higher political profile. He's a former state senator who ran two unsuccessful campaigns for statewide office - lieutenant governor in 1998 and governor in 2002. More recently he's worked at the Holland and Knight law firm.

Healey has served for seven years under current Attorney General Martha Coakley, who is seeking the Democratic nod for governor against Steve Grossman and Don Berwick in the state's highest-profile primary.

Healey served as chief of the Civil Rights Division and directed two other bureaus - the Public Protection and Advocacy Bureau, and the Business and Labor Bureau - before stepping down to launch her campaign.

On many key issues - like a recent update of the state's gun laws - there seems to be little difference between the candidates.

Healey applauded the new law and said if elected, she would use it as part of a "comprehensive plan to target gun violence in our state."

Tolman also praised the law, saying it will "save lives with better tracking of guns, stronger discretion for our police chiefs, provisions to protect our schools and important data collection on suicides."

Still, each candidate has tried to stake out somewhat different territory on the issue of guns.

In a key campaign pledge, Tolman has vowed to push for smart gun technology, including fingerprint trigger locks, on all new guns sold in the state - something he says he could do without new legislation.

Healey has instead focused on a provision in the new law creating a firearms trafficking unit within the state police to help track guns used in crimes. She said as attorney general she would work with police to "shut down illegal guns moving inside Massachusetts and coming in from other states."

Both candidates were also quick to praise lawmakers for passing a new law in response to a decision by the Supreme Court that ruled the state's 2007 35-foot, protest-free "buffer zones" around the entrances of abortion clinics were unconstitutional.

Tolman and Healey each vowed to enforce the law vigorously if elected.

Tolman made the issue of women's safe access to clinics the subject of his first television ad, which featured him speaking in front of the Statehouse, the Supreme Court and one of the abortion clinics where gunman John Salvi opened fire in 1994, killing two receptionists and wounding five others.

One area where the two differed was over how best to deal with the Market Basket family feud that has led to empty shelves, angry customers, and workers of the supermarket chain taking sides and staging protests.

During a recent debate on WGBH-TV Tolman urged action.

"It's a time for leadership," he said. "You don't wait."

Healey said it's not the job of the attorney general to settle a business spat.

"I don't know that we want an attorney general who is going to show up on people's doorsteps," Healey said.

During the same half-hour debate, both candidates said they oppose legalization of marijuana for recreational use and criticized the initial law enforcement response in Ferguson, Missouri, where police used tear gas and smoke bombs to repel protesters after the killing of an unarmed teen.

Healey and Warren have been busily raising money.

At the end of July Tolman reported having raised more than $1 million compared to Healey's $731,000. Healey's campaign manager has since said she's also broken the $1 million mark.

The winner of the Democratic primary will face Winchester attorney John Miller in November, the lone Republican candidate for attorney general.