Patients suffering from serious illness will be able to receive cannabis in order to treat symptoms such as chronic pain, loss of appetite and sickness caused by chemotherapy, according to the legislation.
The law, which was passed in the lower house of parliament and is to take effect in March, requires that health insurance providers cover the costs of the drug.
The use of cannabis for recreation remains illegal in Germany.
Germany is to establish a special agency to monitor and implement industry standards for the production of cannabis-based medicines.
It will then buy the drugs from private companies and sell them on to chemists.
Health Minister Hermann Groehe welcomed the new law in a statement, he said, “ People who are seriously ill must be cared for in the best possible way.’’
Currently, patients have to obtain special permission for medical cannabis, with around 1,000 people granted access to the drug.