WASHINGTON — The District of Columbia Council approved a measure on Tuesday that would allow people with certain chronic illnesses to obtain medical marijuana from a handful of dispensaries regulated by the city.

The 13-member Council voted unanimously to allow doctors to recommend marijuana for people who are infected with H.I.V., as well as people with glaucoma, cancer or a “chronic and lasting disease.”

The legislation permits Mayor Adrian M. Fenty to establish up to eight dispensaries where patients could receive two ounces of marijuana a month. The measure gives the mayor the option of raising the amount to four ounces without further council action.

Some doctors say marijuana helps relieve nausea, vomiting, certain AIDS symptoms and some side effects of chemotherapy. For glaucoma patients, the drug is believed to help lower eye pressure.