OTTAWA (Reuters) - Medical marijuana patients in Canada will be allowed to grow a limited amount of cannabis for their own use or designate someone to grow it for them, the government said on Thursday.

Marijuana is pictured for sale during the annual 4/20 day, which promotes the use of marijuana, in Vancouver, British Columbia April 20, 2013. REUTERS/Ben Nelms

The government had been given six months to comply with a federal court ruling that struck down the previous administration’s ban on medical patients’ growing cannabis.

Health Canada said medical marijuana patients would also continue to have the option of buying cannabis from one of 34 producers licensed by the federal government.

But it reiterated that storefronts selling marijuana, commonly known as dispensaries or compassion clubs, are not authorized to sell cannabis for medical or any other purposes.

“These operations are illegally supplied, and provide products that are unregulated and may be unsafe. Illegal storefront distribution and sale of cannabis in Canada are subject to law enforcement action,” Health Canada said in a statement.

Canada’s former Conservative government overhauled the country’s medical marijuana program in 2013, requiring patients buy cannabis from licensed producers through a mail order system.

A federal court judge in Vancouver ruled in February that the restrictions imposed by the Marijuana for Medical Purposes law were arbitrary.

The changes to the medical program came as Canada and the United States are looking at how to deal with the push to legalize marijuana for medical or recreational uses.

Liberal Prime Minister Justin Trudeau campaigned on a promise to legalize recreational marijuana and the government has said it would introduce legislation by the spring of 2017.

Twenty-five U.S. states have sanctioned some forms of marijuana use for medical purposes, while four allow recreational use. Nine other states have recreational or medical marijuana proposals headed for their ballots in the November election.

The U.S. Drug Enforcement Administration earlier on Thursday denied requests to loosen the classification of marijuana as a dangerous drug with no medical use.

Shares of Canadian medical marijuana producers edged lower after the announcement. Canopy Growth was down 11 Canadian cents at C$4.04, while Mettrum Health fell 15 Canadian cents to C$2.75.