Updated

Uruguay has taken a critical step towards passage of an unprecedented plan to become the first nation to create a legal marijuana market.

On Wednesday just before midnight all 50 members of the ruling Broad Front coalition of the lower house of the Uruguay Congress approved the proposal in a party line vote, keeping a narrow majority of the 96 lawmakers present after more than 13 hours of passionate debate.

The measure now goes to the Senate, where passage is expected to make Uruguay the first country in the world to license and enforce rules for the production, distribution and sale of marijuana for adult consumers.

Legislators in the ruling coalition said putting the government at the center of a legal marijuana industry is worth trying because the global war on drugs had been a costly and bloody failure, and displacing illegal dealers through licensed pot sales could save money and lives.

They also hope to eliminate a legal contradiction in Uruguay, where it has been legal to use pot but against the law to sell it, buy it, produce it or possess even one marijuana plant.

"Uruguay appears poised, in the weeks ahead, to become the first nation in modern times to create a legal, regulated framework for marijuana," said John Walsh, a drug policy expert at the Washington Office on Latin America. "In doing so, Uruguay will be bravely taking a leading role in establishing and testing a compelling alternative to the prohibitionist paradigm."

Opponents of the proposal warned that marijuana is a gateway drug and said fostering the bad habits of addicts is playing with fire.

President Jose Mujica had postponed voting for six months to give supporters more time to rally public opinion. However, recent polls said two-thirds of Uruguayans remained opposed despite a "responsible regulation" campaign for the bill.

National Party Deputy Gerardo Amarilla said the government was underestimating the risk of marijuana, which he called a "gateway drug" for other chemical addictions that foster violent crimes.

"Ninety-eight percent of those who are today destroying themselves with base cocaine began with marijuana," Amarilla said. "I believe that we're risking too much. I have the sensation that we're playing with fire."

Dozens of pro-marijuana activists followed the debate from balconies overlooking the house floor, while others outside held signs and danced to reggae music.

"This law consecrates a reality that already exists: The marijuana sales market has existed for a long time, but illegally, buying it from traffickers, and in having plants in your house for which you can be thrown in jail," said Camilo Collazo, a 25-year-old anthropology student. "We want to put an end to this, to clean up and normalize the situation."

Mujica, for his part, said he never consumed marijuana, but that the regulations are necessary because many other people do. "Never in my life did I try it, nor do I have any idea what it is," he told the local radio station Carve.

The heavy toll, costs and questionable results of military responses to illegal drugs have motivatedmarijuana legalization initiatives in the U.S. states of Colorado and Washington, and inspired many world leaders to re-think drug laws.

The secretary-general of the Organization of American States, Jose Miguel Inzulza, told Mujica last week that his members had no objections. Pope Francis, however, said during his visit to Brazil that the "liberalization of drugs, which is being discussed in several Latin American countries, is not what will reduce the spread of chemical substances."

Under the legislation, Uruguay's government would license growers, sellers and consumers, and update a confidential registry to keep people from buying more than 40 grams a month.

Carrying, growing or selling pot without a license could bring prison terms, but licensed consumers could grow up to six plants at a time at home.

Growing clubs with up to 45 members each would be encouraged, fostering enough marijuana production to drive out unlicensed dealers and draw a line between pot smokers and users of harder drugs.

The latest proposal "has some adjustments, aimed at strengthening the educational issue and prohibiting driving under the effects of cannabis," ruling coalition deputy Sebastian Sabini said. "There will be self-growing clubs, and it will also be possible to buy marijuana in pharmacies" that is mass-produced by private companies.

An Institute for Regulation and Control of Cannabis would be created, with the power to grant licenses for all aspects of a legal industry to produce marijuana for recreational, medicinal or industrial use.

Based on reporting by The Associated Press.

Follow us on twitter.com/foxnewslatino
Like us at facebook.com/foxnewslatino