Ohio Governor John Kasich speaks as he withdraws as a U.S. Republican presidential candidate in Columbus, Ohio, U.S., May 4, 2016. REUTERS/Aaron JosefczykCLEVELAND (Reuters) – Lawmakers in Ohio on Wednesday approved legislation that would legalize marijuana use for medical purposes under certain circumstances, less than a year after recreational marijuana use was soundly defeated by Ohio voters.

During the last few years, state legislatures and voters in the United States have been much more receptive to making the use of marijuana legal for medical purposes than for recreational use.

Some 24 states and Washington D.C. currently allow some type of medical marijuana use while only a handful of states allow for recreational use. It remains illegal on the federal level.

The Ohio legislation is more limiting than some in that it only allows patients with specific medical conditions to use an oil, edible, tincture or vapor form of marijuana prescribed by a physician licensed in the state, starting in 2017.

“This bill is not perfect, but it’s what Ohio patients need,” Ohio Senator Kenny Yuko, a Democrat, said before his house approved the bill.

“Marijuana is not a gateway drug, but a gateway off drugs.”

Medical marijuana users would not be allowed to smoke or grow their own marijuana under the measure, which also would create a commission responsible for regulating and licensing of all operations of the drug.

In November, Ohio voters soundly rejected a measure that would have made it the first U.S. Midwestern state to legalize the recreational use of marijuana.

Lawmakers from both parties voted for and against the bill on Wednesday. Some opponents of the measure have said that the qualifying list of medical conditions is too limited.

The measure was fast-tracked to head off a possible less-restrictive medical marijuana ballot initiative in November.

In a poll released in early May, 90 percent of Ohio voters supported the legalization for medical marijuana.