At a time when Massachusetts has been eliminating mandatory minimum sentences for nonviolent drug crimes, Republican attorney general candidate Jay McMahon wants to go in the opposite direction.

McMahon says he will, if elected, institute "extreme prosecution" for crimes involving drugs, asking for the maximum legal sentence in every case. "I would instruct prosecutors that we take every case to the max when it comes to drugs," McMahon said.

McMahon is running against Dan Shores in the Sept. 4 Republican primary for attorney general. The winner will take on incumbent Attorney General Maura Healey, a Democrat.

McMahon, whose son died of opioid addiction, has made his top priority addressing drug crimes.

In addition to what he calls "extreme prosecution" for drug crimes, McMahon supports the state working with federal law enforcement, including U.S. Immigration and Customs Enforcement, to stop the flow of drugs into the country.

McMahon also wants to expand private pay rehabilitation programs, arguing that treatment programs paid for with government money are ineffective.

McMahon's son Joel hurt his back while serving in the U.S. Army in Iraq. According to McMahon, his son was given opioids by Veterans Affairs doctors for years. When VA doctors started prescribing a lesser supply of opioids, part of an attempt to stop addiction, his son turned to the black market. Joel McMahon died in 2008, a day before his 29th birthday.

McMahon argues that harsher punishments will deter "drug-trafficking thugs" from "peddling this poison" in the state. "Put people in jail, and they know it's not a good place to ply their trade," McMahon said.

As part of his fight against drugs, McMahon opposes "sanctuary state" policies that prohibit state and local law enforcement from cooperating with federal immigration authorities to arrest or deport people without legal status. Several communities like Cambridge, Somerville and Amherst currently do not cooperate with U.S. immigration officials.

If local authorities shelter immigrants without legal status, McMahon said, "They're violating their oath of office. They're also entering into conspiracies to violate federal and state law. They're also entering conspiracies to harbor fugitives from justice."

"I will not just do nothing like Maura Healey," McMahon said. "I will start going after the various cities and public officials who are determining that it is politically expedient to violate the law and take the stand they're taking with respect to sanctuary cities."

Another drug-related issue that will confront the next attorney general is how to deal with state marijuana laws. Massachusetts legalized recreational marijuana in 2016, and retail shops are expected to open imminently. Marijuana remains illegal under federal law. McMahon criticized Healey for certifying the ballot question legalizing marijuana as constitutional, even though Healey opposed the substance of the measure.

McMahon said he would defer to the federal government to enforce federal law. But he would not defend marijuana businesses operating under state law.

"I'm going to tell them you do it at your peril, because we have a conflict of laws," McMahon said.

McMahon personally supports medical marijuana but opposes recreational marijuana because of the increased risk of traffic fatalities.

McMahon, 64, grew up in Buzzards Bay, in Bourne on Cape Cod. He now lives in a house across the street from where he grew up.

McMahon worked his way through college and law school, attending Cape Cod Community College, Southeastern Massachusetts University, which is now the University of Massachusetts Dartmouth, and Suffolk Law School.

He served in the Army National Guard as a second lieutenant in the military police. He worked in corporate management for several companies.

After graduating from law school in 1988, he joined his father's law firm, then started his own practice when his father retired. He is a trial lawyer with a general practice.

McMahon said he has been dismayed for the last 20 years seeing the attorney general's office being used "by political activists from the extreme left."

McMahon said Healey has "gutted civil rights for the citizens of Massachusetts." In particular, McMahon pointed to Healey's 2016 reinterpretation of the state's assault weapons ban to outlaw certain copies of guns that had previously been sold legally.

McMahon also criticized Healey for opposing President Donald Trump's travel ban in federal court.

Healey argued that banning nationals of certain foreign countries from traveling to the U.S. hurt Massachusetts businesses and universities and was an illegal attempt to discriminate against Muslims.

McMahon supports Trump's policy as a step to keep Americans safe by preventing militants from terrorist organizations from entering the country.

"(Healey) would have disarmed us in July of 2016, and in January 2017 allowed those savages to come in amongst us and put us at their mercy," McMahon said, referring to Healey's actions on the assault weapons ban and the travel ban.

McMahon opposes a new state law allowing a family member to petition a court to issue an "extreme risk protection order" to temporarily take someone's gun away if they pose a threat to themselves or someone else.

"It's the Legislature's solution to a nonexistent problem," McMahon said. He said Massachusetts does not have "people who all of a sudden were suffering mental incapacities going around shooting people."

McMahon said there is no reason to regulate guns made with 3D printers. He said they are no different than "zip guns," homemade guns that have been around for years and can be made from car antennas.

"Anyone can make a gun, anybody can buy a gun on the black market. ... You can take any household items and make a destructive device," he said.

McMahon said the solution to mass shootings is for law enforcement to act more quickly on active intelligence.

McMahon said he will "obey the law" that Massachusetts voters pass in November when they vote whether to repeal the state's transgender anti-discrimination law. The law forbids discrimination against transgender people in public places, like restaurants and movie theaters. It allows transgender people to use the restroom that conforms with their gender identity.

Personally, McMahon said he opposes "invasive rights," a term he used to describe allowing transgender women, who were born male, into women's locker rooms.

"I don't know that women decided to give up their right to privacy to men," McMahon said. "I'm not in favor of my daughter's locker room being invaded by men."

McMahon believes abortion and gay marriage should be decided by the states, not the U.S. Supreme Court. He believes laws on both subjects should be voted on by ballot referendum.

"When you have something that has very serious implications to society, the people should be able to vote on it, the people should all weigh in," McMahon said.

So far, McMahon has raised around $80,000 for his campaign.