Epidiolex uses purified cannabidiol, or CBD, which is one of more than 80 active compounds in the cannabis plant.
"This is an important medical advance," said US Food and Drug Administration Commissioner Scott Gottlieb.
"But it's also important to note that this is not an approval of marijuana or all of its components. This is the approval of one specific CBD medication for a specific use," he added.
"And it was based on well-controlled clinical trials evaluating the use of this compound in the treatment of a specific condition."
The drug is approved for use against Lennox-Gastaut syndrome and Dravet syndrome in patients two years of age and older, the FDA said.
An advisory panel to the FDA recommended in April that the drug be approved.
The FDA is not required to follow the advisory panel's advice but usually does.
CBD does not cause intoxication or euphoria. That so-called "high" comes from a different compound in marijuana, known as tetrahydrocannabinol (THC).