A Cannabis plant. (Alessandro Bianchi/Reuters)

A bill meant to pave the way for producing therapeutic marijuana oils in Virginia cleared its last legislative hurdle on Tuesday.

The Senate voted 39 to 0 in favor of the bill, with Sen. Bryce E. Reeves (R-Spotsylvania) not voting. Parents with severely epileptic children, who have struggled to obtain the oils used to treat the condition, broke into tears as they watched the vote from the Senate gallery.

Last year, the General Assembly passed a law intended to make it easier for people with severe forms of epilepsy to use two oils derived from marijuana, which lack the plant’s intoxicating properties but help alleviate debilitating seizures. The bill provided a way for epileptics or their legal guardians to avoid prosecution for possession of cannabidiol oil (also known as CBD) and THC-A oil.

The law passed in Virginia last year was intended to prevent patients or their caretakers from being prosecuted for possession of the oils, but it stopped short of making the oils legal. It did not provide a way for patients to obtain the oils.

The oils are sold legally in Colorado, but makers there are wary of shipping them across state lines because doing so violates federal law. Parents have risked prosecution for traveling to Colorado and transporting the oils themselves. And they would have to make frequent trips because the oils have only a 30-day shelf life.

But last year’s bill laid the groundwork for possibly producing the oils in Virginia after 2017, when and if the legislature votes to reenact it. The law says that no pharmaceutical processor could produce the oils without first obtaining a permit from the state Board of Pharmacy.

The current bill, which now heads to Gov. Terry McAuliffe (D), would direct the board to start to develop those regulations. Sen. David W. Marsden (D-Fairfax), who sponsored the measure, said he did not want to wait until the measure is reenacted next year because the regulatory process takes as long as 280 days.