Mexico's Supreme Court on Monday declared a ban on the recreational use of cannabis unconstitutional.
With a strong majority, the court ruled sections of Mexico's general health law to be unconstitutional.
The change does not universally legalize marijuana products. Adults wanting to consume or grow cannabis will need to apply for permits from the health secretariat.
Selling the drug will continue to be illegal, and criminal penalties for its sale and for possessing more than five grams of marijuana remain in place.
In 2019 the court ruled that a complete ban on recreational use of marijuana was unconstitutional, saying that all persons of legal age have the right to "decide - without any interference - what kind of recreational activities they wish to carry out."
The court gave Mexico's parliament a deadline to pass a law to legalize cannabis. The deadline has been extended several times, but the two chambers of Congress have not yet agreed on a legal text.
The court on Monday again called on parliament to pass such a bill.
The new law would end more than 100 years of cannabis prohibition in Mexico, a country plagued by drug cartel violence.
The Latin American nation of 126 million inhabitants would become the third country in the world to create a legal marijuana market nationwide after Uruguay and Canada.