Democrat Attorney General Maura Healey and her Republican challenger, trial attorney Jay McMahon, presented starkly different law enforcement philosophies during their first debate ahead of the general election in November. The debate was hosted by WGBH News and moderated by Jim Braude and Margery Eagan.

Not only was Wednesday the first debate for this race — but it was also the first time the candidates had met each other in person.

During the half-hour debate, the candidates clashed over enforcement of the state’s gun laws, combating the opioid crisis and criminal justice matters.

Healey was elected attorney general in 2014 and is running for a second term. She has been a vocal critic of President Trump and has gained national attention for bringing several lawsuits against him since he was elected.

McMahon, an attorney from Bourne and a supporter of the president, disagreed with Healey on a number of issues, including a controversial characterization of the criminal justice system by Sen. Elizabeth Warren.

In August, Warren said, "the hard truth about our criminal justice system: It's racist ... I mean front to back.”

Asked to respond to Warren, Healey said, “I think that we’ve got to work to improve the fairness of the criminal justice system.”

“I represented African Americans and minorities. I have not seen a racist [system] from front to back,” McMahon responded. “Law enforcement needs to know we’ve got their back. Now I can tell you for a fact there is no racism in the law enforcement system.”

McMahon also took issue with how Healey has carried out her role as the state's top cop, accusing her of overstepping.

“One of the things that Maura Healey has been is a political activist and not only enforcing law, but going beyond that by creating her own law almost like a super legislator,” McMahon said.

Asked to explain, McMahon referenced Healey’s order to ban copycat assault weapons and referred to the step up in enforcement as a “reinterpretation” of a 2004 law banning assault weapons.

“I think it’s probably pretty clear I’m not the NRA’s favorite candidate in this race,” Healey responded. “When I learned in 2015 [that] 10,000 assault rifles were sold in Massachusetts in violation of the law, I did my job as attorney general and I sent notice and made clear that we would enforce the law and that those sales are prohibited under existing law.”

McMahon later said he would enforce the existing assault weapons ban, but admitted, “Personally, I do not like it.”

On the opioid crisis, to which McMahon lost his son, the Republican candidate said that Healey is too soft on crime.

“There’s an opioid epidemic here in Massachusetts," he said. "People continue to die, 2,000 a year. We've got to do something about it. We've got to start driving these pushers, either put them in jail or drive them out of state … We’re fighting a war here,” he said.

Healey argues that she has been working to combat the opioid crisis.

“First thing I did — set up a fentanyl strike force [and] secured $1 million from the federal government to go after the cartels," she said. "Every day, we are bringing cases to break down heroine and fentanyl drug trafficking operations. We sued Perdue pharma and its executives, and we are leading a multi-state investigation into all opioid manufacturers and distributors."

Massachusetts voters will decide who will serve as the state's top lawyer in the general election on Nov. 6.