BERLIN (AP) — German lawmakers have approved legislation that would allow some patients to get cannabis as a prescription-only medication.

Parliament’s lower house passed the bill unanimously on Thursday. The vote clears the way for the law to take effect in March.

Health Minister Hermann Groehe has stressed the move does not mean marijuana will be legal for non-medical purposes.

Groehe says: “Seriously ill people must be cared for in the best way possible” and that includes allowing the public health system to fund cannabis prescriptions for patients “if they cannot effectively be helped any other way.”

Patients in Germany previously have had to seek special authorization to use the drug and around 1,000 people did so. Until a cannabis-growing program is started in Germany, prescriptions will be filled with imported marijuana.