The Republican candidates for attorney general clashed bitterly over their experience in a lively debate on Boston Herald Radio that showed sharp differences in the candidates’ backgrounds and priorities.

“The last thing Massachusetts needs is another sue-happy attorney general,” said Dan Shores, a South Shore attorney who faced off against Cape Cod lawyer Jay McMahon in the debate on the “Battenfeld” show on Thursday.

Shores, who admitted he has no specific law enforcement experience, criticized McMahon’s background, which includes decades as a trial lawyer.

“Just because you have 30 years of small cases before our state courts does not qualify you as the next attorney general,” Shores said. “Open any Yellow Pages, you’re going to see a lawyer just like attorney McMahon with the same level of experience.”

McMahon quickly fired back, attacking Shores for failing to try cases in the Massachusetts courts.

“I’m listening to Dan Shores and he’s giving us a reason why he has no experience at all in the Massachusetts court system where the attorney general operates,” McMahon said. “It’s absolutely ludicrous to say he has three years as a patent lawyer and has not one case in the Massachusetts court system, and he is going to hire litigators, he’s going to counsel litigators on how to operate in a Massachusetts court and he’s never been in one.”

The exchange was the harshest yet of the campaign, and came as both candidates are struggling for name recognition and attention in the primary battle to face off against Attorney General Maura Healey.

McMahon and Shores also disagreed on gun control legislation, with McMahon saying he opposed a ban on so-called bump stocks, which can cause a semi-automatic weapon to fire faster and were used by the shooter in the Las Vegas massacre.

“I have a lot of guns,” McMahon said. “Licensed gun owners in Massachusetts don’t commit gun crimes. I’m not in favor of any more restrictions. We already have too many.”

Shores also said he was a licensed gun owner but supported the bump stock ban.

The candidates also agreed on a number of issues, including supporting mandatory minimum sentences for drug crimes and supporting the death penalty for certain opioid drug dealers who are found to contribute to overdose deaths.

Both candidates also described themselves as supporters of President Trump, with McMahon saying he attended Trump rallies and the inauguration. Shores also said he backed the president on most issues, including on immigration.

“But if there’s something the president is doing, that the White House is doing, that hurts the people of Massachusetts and I’m the attorney general, then I will push back against the administration,” Shores said.