Mexico's Senate has overwhelmingly approved a bill allowing for the use of medical marijuana, in a further step towards outright legalisation in a country long wracked by warring drug cartels.
The bill, part of a proposal President Enrique Pena Nieto submitted to Congress earlier this year, must also be passed by Mexico's lower house to become law.
The measure passed 98-7.
Since a court ruling last year, the government has allowed the importation on a case-by-case basis of medicine with cannabidiol (CBD), an active chemical ingredient of the drug.
The bill, passed on Tuesday, envisages permitting use of products containing the psychoactive ingredient tetrahydrocannabinol (THC).
The measure would also allow for production of marijuana for scientific and medicinal purposes.
Lisa Sanchez, director of drug policy for Mexico Unido Contra la Delincuencia, a group working to curb crime, said Tuesday's decision was "not the end of the road".
"It's been years we've been fighting for acknowledgment and approval and recognition of the medical and therapeutic uses of cannabis, and today we finally have something," she said.
Recreational marijuana is still broadly prohibited in Mexico, but last year the Supreme Court granted four people the right to grow their own marijuana for personal consumption, opening the door to legalisation.