Japan's parliament on Wednesday passed a bill to legalize medical products using substances derived from cannabis while also plugging a loophole in existing prohibitions against the drug by criminalizing its use.

Drugs made from cannabis plants are currently only permitted in clinical trials in Japan, but patient groups have been calling for access to cannabis-derived cannabidiol medicines already approved in Europe and the United States for conditions such as severe epilepsy.

Under the revised laws, which enter into force within a year from promulgation, cannabis and tetrahydrocannabinol (THC), a psychoactive chemical found in the plant, are designated as narcotics to be regulated.

While the possession and cultivation of marijuana are already banned in Japan, the country will prohibit its use as well, setting a prison sentence of up to seven years for violation.

Previously, Japan did not penalize cannabis use, partly to protect farmers who may accidentally absorb its substances while growing it for use in hemp products. But it reversed its stance amid growing concerns that the lack of a ban on use is promoting drug abuse by young people.

Through the changes, there will be two kinds of licenses for growing cannabis, with one for those who grow it to make medicines and another for other purposes such as hemp.

The legal changes associated with cultivation will enter into force two years after announcement.