Mexico has moved a step closer to legalising cannabis for recreational use, after lawmakers passed a bill aimed at curbing violent crime linked to drug trafficking.
The country's upper house of parliament, the Senate, backed the bill by 82 votes to 18 on Thursday.
The Senate said the bill's objective was to reduce organised crime by shrinking the illegal drugs market.
The bill must be approved by the lower house by mid-December to become law.
If passed, the bill would mark a change of approach to drugs for the country.
Mexico has long struggled with a bloody war against powerful drug cartels, with violence killing tens of thousands of people every year.
But public opinion about legalisation in Mexico has shifted in recent years, reflecting a growing sentiment in Latin America and elsewhere that the current prohibition on drugs should change.
In a landmark ruling, Mexico's Supreme Court opened the door to the recreational use of marijuana in 2018.
The court effectively overturned the ban on using cannabis recreationally, but it still remains illegal to carry more than five grams (0.18 ounces) of the drug.
The bill passed by the Senate would change that, paving the way for the creation of one of the world's largest lawful marijuana markets.
How would the bill change the law on cannabis?
The Senate said in a statement that the bill's objective was "to promote peace and security in society, contributing to the reduction of the illegal market for psychoactive cannabis and with it, organised crime, corruption and violence".
The legislation would let users carry up to 28g and grow as many as four plants at home.
Businesses would be allowed to sell cannabis to adults, but anyone possessing more than 28g of the drug could still be fined or criminally prosecuted.
Children would still be banned from buying, using or selling the drug.
Should the bill be approved, Mexico would become the third country in the world, after Uruguay and Canada, to legalise cannabis for recreational use nationwide.
In addition to decriminalising the recreational use of cannabis, the bill would allow for the drug to be used for scientific, medical and industrial purposes.
What have supporters and critics said about the bill?
There was passionate debate in the Senate, where the ruling left-wing party of Mexican President Andrés Manuel López Obrador holds a majority.
Outside the Senate, a garden of cannabis in a nearby public park has become a rallying point for pro-legalisation activists.
Supporters of the bill say accountable state regulation of the drug will undermine the link between organised crime and the cannabis trade.
More on Mexico's war on drugs:
Green Party Senator Raul Bolaños told the chamber the legislation was long overdue and served Mexico's best interests.
"The day has come, after two years of hard work in this Senate, we will be able to end 100 years of unnecessary prohibition," he said.
"In these two years of work, we have come to a verdict which allows for the free development of character, for the health of Mexicans and for the well-being of the entire nation."
But critics argue the bill could make cannabis more accessible to children and cause health problems.
Damián Zepeda Vidales from the National Action Party opposed the move on those grounds.
"When we are going to vote for a reform, we should always ask ourselves whether it is going to bring something positive to the country or not," he said.
"Without a doubt in this case, we feel it won't. We don't think it's positive that it will be accessible to youngsters and also children."