RALEIGH, N.C. (AP) — Marijuana would be legalized for medical use in North Carolina with a physician’s prescription and purchased through dozens of tightly regulated dispensaries in a measure receiving initial approval Thursday in the Senate.

The legislation, which received strong bipartisan support, could help people facing more than a dozen different “debilitating medical conditions” in which their doctor declares the health benefits of smoking or consuming cannabis outweigh the risks.

The bill’s chief sponsors, however, focused on giving relief to patients with terminal illnesses that bring unbearable pain and suffering, while preventing them from having to act illegally.

“It is our duty as lawmakers to pass legislation that helps people who need our help,” said Brunswick County Republican Sen. Bill Rabon, a cancer survivor who has worked on this legislation for five years. “It is not going to make them ashamed or reluctant to seek help if it is recommended to them by their physician.”

Seventeen of the 25 Republicans and all but two Democrats present Thursday cast votes for the bill, which passed 35-10 and needs one more affirmative vote next week before it heads to the House.

Many House Republicans have been suspicious about legalizing cannabis in any form. Speaker Tim Moore said Thursday he believed medical marijuana would have to wait until 2023. Legislative leaders are aiming to adjourn this year’s work session around July 1.

Still, the Senate’s affirmative vote, which included a “yes” from chamber leader Phil Berger, shows how far political and public sentiment has come in the Bible Belt state on medical marijuana. Rabon has said that polls show support is strong for the idea across all population groups, including among evangelical Christians.

The bill worked its way through several committees last summer before resurfacing this week. Senators have heard from impassioned speakers with severe illness who say marijuana can ease pain or help them lead more normal lives.

Thirty-seven states and the District of Columbia allow the medical use of cannabis products, according to the National Conference of State Legislatures.

“The time for action in North Carolina is now,” said Democratic Sen. Wiley Nickel of Wake County, who recalled how his father used marijuana unlawfully three decades ago as he was dying of cancer. Marijuana for recreational use would remain illegal.

Bill opponents have said the health benefits of marijuana remain uncertain and the health risks are great.

“We spent billions of dollars ... to stop people from smoking (and) we’re now voting on a new version of Big Tobacco,” said Sen. Jim Burgin, a Harnett County Republican who voted no.

Under the bill, other qualifying conditions that could lead to legal marijuana access include epilepsy, Crohn’s disease, HIV/AIDS, amyotrophic lateral sclerosis and post-traumatic stress disorder. An advisory board could add to that list. Physicians initially would have to receive 10 hours of training to offer a cannabis prescription.

A new Medical Cannabis Production Commission would award licenses to 10 entities that would grow cannabis, process it and sell it.

Each licensee could open eight medical cannabis centers across the state. They could sell up to 30-day supplies of marijuana or cannabis-infused products to patients or their caregivers, who would have to obtain registration cards from the state Department of Health and Human Services. The licensees would have to send 10% of their monthly revenues to the state.

People could face felonies if marijuana at cannabis centers or production facilities is sold unlawfully. Registered patients who smoke pot in public or near a school or church could face $25 fines.

Sen. Julie Mayfield of Buncombe County offered a floor amendment that would have directed the commission to recommend a system that she said would help in-state growers and retailers participate.

Language in the measure otherwise would leave the licenses to multistate corporations, she said, leaving small businesses on the sidelines. Republicans used a parliamentary maneuver to derail a vote on the amendment. Mayfield was one of the two Democrats to vote against the full bill Thursday.