The bill still needs to be approved by Parliament's upper house.
The lawmakers agreed Friday that marijuana would be imported and later grown locally by registered firms licensed for such activity, which is currently illegal.
Patients will need a prescription from a doctor to get the drug at pharmacies, and treatment will not be covered by health insurance. Patients wouldn't be allowed to grow marijuana at home.
Medical marijuana use is legal in a number of European countries and parts of the United States. The drug is commonly used to relieve conditions such as chronic pain and cancer.