A Haverhill drug bust this week uncovered an underground network of people with medical marijuana cards flouting state law by buying and selling pot on the black market, according to police and a member of the group.

Detectives arrested John Rielly, 36, of Watertown on Thursday after they found him meeting with a 38-year-old Haverhill woman in a parking lot — his car packed with over half a pound of marijuana and pot-infused candy worth more than $3,000, according to police reports.

The woman told police she was meeting Rielly for the first time to buy pot after finding him through website advertisements for Boston Herbal Organization, the report states. Police said Rielly and the woman both showed cops their medical marijuana cards.

“John Rielly is a medical marijuana patient,” said Gerard Hadley, the self-described organizer behind Boston Herbal Organization. “John decided to help somebody and obviously that went wrong.

“There are no clinics open,” Hadley added. “There’s nowhere to get medical marijuana right now. What do you do if you’re in pain? We’re helping and assisting each other. We’re not breaking the law.”

Hadley said the group doesn’t charge membership dues and anyone with a medical marijuana card can join. He said he’s a card-carrying member being treated for “tons of ailments” and he doesn’t sell marijuana but merely acts as a facilitator — connecting patients with marijuana to other patients willing to “share” at a cost.

After the Herald called Hadley yesterday, the group’s Facebook page was taken down. The page had listed long marijuana menus for “Blue Dream” and “Candyland” as well as pot-infused candies.

A man who answered the door at Hadley’s business address in the Seaport District on Sleeper Street — a condo about a block away from the federal courthouse with the strong smell of marijuana wafting from the doorway — said he did not know Hadley. Hadley later told the Herald he had heard from associates that the Herald had stopped by the condo.

Boston officials were not familiar with Boston Herbal Organization before the Herald brought attention to it, but a spokeswoman for Mayor Martin J. Walsh said police “are looking into it now.”

Haverhill police said they recovered more than $1,600 from Rielly and found drug ledgers showing marijuana deliveries in multiple cities. Cops said the names on the envelopes of pot found in Rielly’s car — like “Girl Scout Cookie” — directly matched the full online menu offering of Boston Herbal Organization.

Rielly was arraigned yesterday on a charge of possession with intent to distribute a Class D substance and released on a bail warning with an order to appear Jan. 14 for a pretrial hearing.

Efforts to reach Rielly and the woman were unsuccessful yesterday.

Patient-to-patient transactions are prohibited under state regulations, which only allow sales at registered dispensaries.

It’s been two years since voters approved medical marijuana. The licensing process is still ongoing. In anticipation of pot shop openings, thousands have received approval from health care providers to register as medical marijuana card holders.

Owen Boss contributed to this report.