Mexico's Supreme Court on Wednesday gave the green light to growing marijuana for recreational use in a landmark decision that could lead to legalization in a country with a bloody history of conflict with drug cartels.

Supporters of reform sparked up joints to hail the court's decision, which, while not legalizing use of marijuana, is one of the boldest steps ever taken in that direction in a country long reluctant to liberalize drug laws.

"We've seen how drug policy and prohibition have only helped drug traffickers rake in money and commit terrible crimes to control drug markets," said 27-year-old Meliton Gonzalez, one activist celebrating outside the court.

Four more consecutive decisions of the same kind and the court's ruling would become jurisprudence, setting a legal precedent in Mexico, which has suffered well over 100,000 deaths due to drug-related crime over the past decade, and force the government to review the law.

Ruling on a case first brought in 2013 by an advocacy group that health regulators stopped from growing plants for private consumption, the court voted 4-1 that prohibiting people from cultivating the drug for personal use was unconstitutional.

Proponents of drug reform argue that criminalizing drugs has only raised their street value and put unnecessary strain on the penal system by filling prisons with low level dealers or people caught with small amounts.

Mexican President Enrique Pena Nieto, who has so far been skeptical about the merits of liberalizing drug laws, responded to the ruling by saying on Twitter it would "open a debate on the best regulation to inhibit drug consumption."

"This does not mean that you can freely commercialize, consume and legalize the consumption of marijuana," Pena Nieto said later, adding that raids to destroy illegal marijuana crops would continue apace.

Government officials sought to reinforce the message on television, telling the public the ruling was isolated to the four people who brought the case and insisting cultivating marijuana remained illegal for the rest of the population.

Marijuana, along with cocaine, heroin and crystal meth, has been a major source of income for cartels that authorities say generate billions of dollars worth of sales annually.

As deaths from drug violence increase, political pressure has mounted on Mexico to follow the example of Uruguay and some U.S. states to make its policy on marijuana more liberal.

The decision comes a day after U.S. legalization advocates were dealt a big setback in a lopsided vote in Ohio against allowing pot for both medical and recreational use.

Giving cautious backing to liberalizing usage, Judge Jose Ramon Cossio said Mexico would need to overhaul its laws as the Supreme Court took what he described as an "important step toward legalization of drugs, or at least some of them."

Alberto Islas, a security consultant, said he expected marijuana to be legalized within the next three or four years, and that drug policy would be a key issue in the 2018 presidential race.

"It will have to pass through the legislature, and that will be the slow part," he said.

Production and sale of marijuana is illegal in Mexico. Still, in 2009, the country made it legal to carry up to 5 grams (0.18 ounce) of marijuana, 500 milligrams (0.018 ounce) of cocaine and tiny amounts of heroin and methamphetamine.

The court's decision could hasten efforts by Mexico's states to change their drug laws, which have so far yet to advance beyond limited debate over the use of medical marijuana.

In August, a lower court in Mexico granted a mother and father the right to import a marijuana-based medicine to treat their 8-year-old daughter's epilepsy.

Last year Pena Nieto hinted that he was adopting a more liberal stance on marijuana, saying that Mexico and the United States could not pursue diverging policies on the issue.

(Writing by Dave Graham and Gabriel Stargardter; Editing by Simon GardnerChristian Plumb and Leslie Adler)