BELFAST, Maine — A Montville medical marijuana patient who fought charges of felony drug trafficking and misdemeanor marijuana cultivation was partially vindicated last week when a jury found him not guilty of the more serious crime.

Randy Hayes, 58, a former Montville town selectman, was found guilty of the cultivation charge after a two-day trial at Waldo County Superior Court that wrapped up Thursday, Aug. 18. Hayes and his wife, Margot Hayes, were charged after an investigation that began last August, when a Maine Drug Enforcement Agency official drove to their Center Road home and spotted marijuana plants over a picket fence.

The Hayeses, who are licensed medical marijuana patients, were legally permitted to grow their own plants. But the dispute arose over whether the couple exceeded the number of allowed plants and whether those plants were properly secured on their property.

Margot Hayes pleaded guilty earlier this year to cultivation violations and was fined $400. Her husband, however, fought the charges.

Medical marijuana advocates and activists in Maine closely watched the case because they thought it demonstrated that enforcement of pot laws is overzealous.

“The cops are clearly out of step with not only the population and the culture of the medical marijuana community but also the law,” Will Neils of Appleton, a medical marijuana activist, said last week at the courthouse.

According to defense attorney Logan Perkins of Bangor, the case centered on what she described as the near-Byzantine complexity of the laws that govern medical marijuana use in Maine. “The rules are complex, convoluted and sometimes contradictory,” she said after the trial concluded. “The state made its entire case on the idea that [my client] was not in compliance with three column inches in 70 pages of rules. Are the plants vegetative? Are they flowering? Are they male? Are they female? Those are attempts to put strict definitions and draw black and white lines in biological systems, which don’t work that way.”

But Waldo County Assistant District Attorney Bill Entwisle said Randy Hayes violated certain requirements of the medical marijuana act. For example, the prosecutor said, the fence around Hayes marijuana plants had a 30-foot gap in it.

“The rules say that the marijuana had to be in a secure enclosure, and it wasn’t,” the prosecutor said. “That’s why it was criminal behavior, and that was the jury’s findings.”

However, the jury disagreed with the state’s contention that Hayes had engaged in felony drug trafficking, a crime that could have led to a five-year prison sentence. Last August, after police obtained a search warrant and went into the family’s home, they cut down the 57 marijuana plants and seized 11 pounds of marijuana in various stages of processing. Another person who came to the house while the officials were doing their search said he had been purchasing marijuana from the couple.

“Our theory with respect to the charge of trafficking had to do with the quantity of marijuana that [Randy Hayes] possessed,” Entwisle said. “If someone is in possession of a pound or more of marijuana, there’s a presumption that they were trafficking.”

According to the Maine medical marijuana act, which went into effect in September 2013, a patient is allowed to possess 2.5 ounces of prepared marijuana and 8 pounds of “incidental marijuana” in an unprepared state.

“That’s a pretty large quantity,” Entwisle said. “Our theory is that they weren’t in compliance with the act, going back to the fencing. And so this conduct isn’t protected by the act.”

But regulation of the medical marijuana act is simply not as black-and-white as the prosecutor suggested, Perkins said, adding that it does not seem right to her that officers have so much discretion that they could charge a legal medical marijuana grower with a felony.

“One of the officers said we see violations of the medical marijuana program all the time, and most of the time we just tell people what to do to fix it,” she said. “It’s reasonable. So why is this case different? Officers have the discretion to decide when a rule violation results in felony charges, and that’s too much discretion. It’s ripe for abuse.”

But law enforcement officers exercise discretion every day, Entwisle said.

“We’re not robots; we’re human beings,” he said. “I think, generally, police officers in the field and certainly prosecutors in the office exercise discretion all the time and make their decisions based on their best judgment about the best way to go forward.”

Hayes, who will likely not be sentenced until September, faces up to 364 days in jail and a fine of $2,000. Perkins said she plans to file a postconviction motion to ask Justice Robert Murray, who presided over the trial, to reverse the jury’s guilty verdict on the grounds that the arrest was “arbitrary and capricious.”

“I think Randy Hayes is disappointed,” the defense attorney said of the verdict. “I think that in his heart of hearts, he doesn’t believe he was doing anything criminal. He wasn’t out to break the law.”