Uruguay, which, in April, became the second Latin American country to legalize gay marriage, is now the first country in the world to legalize the production, sale and consumption of marijuana.

The law, first proposed in 2012 as a way to combat drug-related crime, will let Uruguayans register to purchase up to 40 grams, or 1.4 ounces, of weed per month from government-licensed pharmacies. They can also grow up to six pot plants in their homes per year. (Consumption of marijuana was already legal.) Private companies will be allowed to grow larger quantities of marijuana, but it will be distributed and sold through state agencies.

What isn't legal (and still won't be, even with the new law) is growing and selling the stuff through non-governmental means. The government isn't doing this out of the goodness of its own heart, after all. It wants to make some money off of it. The country expects to sell weed for one dollar per gram, which will make it "the most affordable marijuana anywhere," according to the Guardian.

The bill's backers celebrated its passage with "green balloons, Jamaican flags in homage to Bob Marley and a sign saying: 'Cultivating freedom, Uruguay grows,'" according to Reuters' Malena Castaldi and Felipe Llambias, who apparently think that Bob Marley was the only Jamaican to smoke pot.

The bill narrowly passed in Uruguay's senate, 16-13, after almost 12 hours of debate. According to the AP, it's not necessarily that popular in Uruguay, with two-thirds of the country opposed.

The law will take effect in 120 days, so weed tourists should buy their plane tickets for no earlier than April.