Gov. Nathan Deal signed an executive order Friday directing state agencies to prepare for legislation that would legalize medical marijuana in an emotional ceremony surrounded by families who would benefit from the drug.

The governor plans to sign the legislation, House Bill 1, next month that would make Georgia the 24th state to allow the drug for medical purposes. It authorizes the limited use of cannabis oil to treat disorders that include cancer, sickle cell disease and epilepsy as long as a physician signs off.

It follows two years of intense lobbying by hundreds of families with children suffering from incurable diseases and symptoms. At least 17 Georgia families have had to move in the past year to places like Colorado where the cannabis oil is legal. Some of those families have been a frequent presence in the statehouse.

Legislators struck a compromise this year with the help of state Rep. Allen Peake, the Macon Republican who championed the bill. It passed despite resistance from conservatives who wanted stricter limits on the drug and overcame the legislative infighting that doomed the proposal last year.

The measure would allow cannabis oil to be used to treat eight disorders: cancer, Crohn’s disease, Lou Gehrig’s disease, mitochondrial disease, multiple sclerosis, Parkinson’s disease, seizure disorders and sickle cell disease.

It opens the door to both children and adults as being eligible for treatment and requires that the oil contain no more than 5 percent THC, the high-inducing chemical associated with recreational marijuana use. It would also legalize clinical trials sought by some senators to further study how the drug works.

Mike Hopkins, who was at the ceremony at Deal's office, choked up as the governor inked the order.

He lost two children to seizure disorders in the last year and temporarily relocated to Colorado so his 17-year-old daughter Michala could use the oil. In the two months before she started taking it, he said she's had 356 seizures. In two months since, she had only 53.

"This is an incredible opportunity," he said. "This is a first step. We've got a long way to go."