BOSTON - The two candidates running for Massachusetts attorney general tussled Wednesday over issues related to gun rights, drug addiction and immigration.

Democratic incumbent Maura Healey faced off against Republican challenger James “Jay” McMahon in a half-hour televised debate hosted by WGBH. Each candidate is asking for the support of Massachusetts voters in the general election Nov. 6.

McMahon, a lifelong resident of Cape Cod, won the Republican nomination last month after beating Dan Shores of Hingham in the primary election. Healey ran unopposed.

McMahon obtained his law degree from Suffolk University and served in the Army National Guard.

Healey worked for seven years in the state Attorney General’s Office before she was elected to the top job in 2014, making her the first openly gay attorney general in the United States.

During the debate, the candidates were divided sharply on issues related to gun control. McMahon, an ardent supporter of the Second Amendment, said government gun control policies rarely reduce violence, but rather take guns out of the hands of law-abiding gun owners and sellers.

“Only legal guns get off the street,” McMahon said.

He was specifically critical of Healey’s 2016 decision to apply the state's assault rifle ban to "copycat" firearms that operate similarly to well-known brands including the Colt AR-15 and the Kalashnikov AK-47, which were previously banned in 1998. A federal judge in April upheld Healey’s interpretation and dismissed a legal challenge.

“It’s probably pretty clear I’m not the NRA’s favorite candidate in this race,” Healey said, noting that the National Rifle Association has already sued her twice.

Beyond guns, Healey and McMahon agreed that the state needs a comprehensive approach to overcome the opioid epidemic in Massachusetts, which on average killed more than three people per day through the first half of 2018,

Read more from our friends at the NRA