Colorado doctors will soon be able to recommend medical marijuana to treat any condition they’ve been prescribing painkillers for.

Gov. Jared Polis on Thursday signed Senate Bill 13, bipartisan legislation that easily passed through the General Assembly. The new law, which is scheduled to go into effect Aug. 2, is a win for marijuana proponents although it concerns some addiction doctors.

“Even in states with flourishing nonmedical cannabis markets, it is important to remember that thousands of people count on cannabis as a medicine,” said David Mangone with Americans for Safe Access, a medical marijuana group. He predicts the bill will reduce opioid overdose deaths.

Under Colorado law, medical marijuana can be recommended for qualifying medical conditions, which were previously defined as cancer, glaucoma, HIV and AIDS, post-traumatic stress disorder or other chronic disorders that cause severe pain, seizures and nausea. The new law adds to that list all conditions for which opioids could be prescribed to treat.

“Our real concern is that a patient would go to a physician with a condition that has a medical treatment with evidence behind it, and then instead of that treatment, they would be recommended marijuana instead,” said Stephanie Stewart, a physician in Aurora who cares for addicted patients.

“This will substitute marijuana for an FDA-approved medication — something that’s unregulated for something that’s highly regulated,” she added.

The new law applies to adults and minors. People under the age of 18 who are taking medical marijuana must do so in a non-smokeable form when using it on school grounds or school buses.

“Adding a condition for which a physician could recommend medical marijuana instead of an opioid is a safer pain management tool that will be useful for both our doctors and patients,” said Ashley Weber, executive director of Colorado NORML, a pro-marijuana advocacy group.

The bill passed through the General Assembly in the final week of session. The House voted 47-16, with some Republicans joining Democrats in support. The Senate voted 33-2, with only conservative Sens. John Cooke, R-Greeley, and Bob Gardner, R-Colorado Springs, in opposition.

The legislation drew considerable attention when it was introduced early this year by two Democrats and two Republicans. A Senate hearing lasted 150 minutes and featured about 40 people, almost all of whom testified in support.

Alexis Bortell, a 13-year-old medical marijuana advocate, told senators she hasn’t had a seizure in the years since she moved from Texas and began taking marijuana to treat her epilepsy. Though Bortell won’t be affected by the new law — seizures are already a qualifying medical condition — she urged senators to expand medical marijuana to all who may need it.

“Colorado law already states that cannabis can be recommended as a medicine by doctors,” Bortell said. “My point is that every patient should have equal access to every medicine our doctor thinks can improve our lives.”

Jennifer Hagman, a psychiatrist who spoke for several Colorado medical groups, called the state and nation’s opioid crisis “a very serious problem” but argued the bill, while well-intentioned, is not a solution.

“Marijuana is not a benign substance,” Hagman told senators. “As a child psychiatrist, I see several kids a month who require admission to an impatient psychiatric unit for the onset of psychosis, which can be quite severe and associated with the use of marijuana.”