Mexico's Supreme Court has given the green light to growing marijuana for recreational use, in a landmark decision that could lead to legalisation in a country with a bloody history of conflict with drug cartels.

Ruling on a case first brought in 2013 by an advocacy group that had been denied permission by regulators to grow plants for recreational use, the court set a precedent by voting 4-1 that prohibiting people from growing the drug to consume it themselves was unconstitutional.

The court's vote does not legalise marijuana consumption in Mexico, but more rulings of the same kind could set a legal precedent.

"It is a drug and thus causes damage," Judge Arturo Zaldivar said. "What holds in the proposal is that the extreme measure of prohibiting it is disproportional in relation to the damage, which has been scientifically proven – under these terms, I will uphold the proposal as it was presented."

Another judge, Alfredo Gutierrez Ortiz Mena, said: "It is unquestionable that the consumption of any drug generates a health problem. However, from a constitutional interpretation there does not exist any reason in which the answer of the state to the consumption of marijuana is the seclusion and absolute prohibition of its consumption."

Outside the court, proponents of change in Mexico's drug laws celebrated the decision by lighting up joints.

The production and sale of marijuana is illegal in Mexico. Still, in 2009, the country made it legal to carry up to 0.18oz of marijuana, 0.018oz of cocaine and tiny amounts of heroin and methamphetamine.

Marijuana, along with cocaine and crystal meth, has been a major source of income for cartels blamed for more than 100,000 drug-related killings in Mexico since 2007.

Political pressure on Mexico to liberalise its stance on marijuana has been rising since the US states of Washington and Colorado legalised the possession and sale of the drug for recreational use in 2012.