A narrow ruling by Mexico's Supreme Court could eventually clear a path to make recreational use of marijuana legal.
Four people in the Mexican Society for Responsible and Tolerant Personal Use will now be permitted to grow and smoke their own marijuana.
Marijuana still cannot be sold in Mexico but some say the court's ruling could lead to full legalisation.
Mexico has long struggled with violent conflict from drug cartels.
The advocacy group first brought the case forward in 2013, seeking permission to grow plants for recreational use.
The court voted 4-1 that prohibiting people from growing the drug for consumption was unconstitutional.
At the scene: Katy Watson, BBC News Mexico City
In a country that faces drug violence on a massive scale, this is a significant ruling. Although the ruling only applies to the individuals who brought the case to the Supreme Court, activists see this as a huge first step.
Armando Santacruz was one of the plaintiffs. A prominent businessman here in Mexico, he has spearheaded the campaign and told me he sees this as opening the door to many more cases.
But Mexicans are divided when it comes to the legalization of drugs. Mexico's President Enrique Pena Nieto has been firmly against any change to drug policy so the battle to legalise marijuana here has only just begun.
It could set a legal precedent for future rulings concerning the use and sales of marijuana.
People celebrated the ruling by smoking joints outside of the Supreme Court building.
"If ... this supreme court is taking such an important step toward legalization of drugs, or at least some of them, I suggest that we are equally careful and responsible in crafting a ruling of the same magnitude," said Judge Jose Ramon Cossio, who voted in favour of the measure.
There are tens of thousands of drug-related killings in the country every year.
The country has been pressured to loosen its drug laws after the US made the drug legal in certain states.
In 2009, Mexico made it legal to carry up to 5 grams (.18oz) of marijuana.