Uruguay's decision to legalise the production, sale and consumption of marijuana violates international law, the UN drugs watchdog says.
The International Narcotics Control Board (INCB) warned that the move would endanger young people and "contribute to the earlier onset of addiction".
The new law will allow registered Uruguayans over 18 to buy up to 40g (1.4oz) of the drug a month.
The government hopes it will help tackle drug cartels.
INCB chief Raymond Yans said he was "surprised" that the government in Montevideo had "knowingly decided to break the universally agreed and internationally endorsed treaty".
In a statement, Mr Yans said claims the law would help reduce crime relied on "rather precarious and unsubstantiated assumptions".
The INCB is an independent body of experts established by the United Nations to monitor countries' compliance with international drug treaties.
After nearly 12 hours of debate on Tuesday, senators gave the government-sponsored bill their final approval, making Uruguay the first country in the world to legalise the production and sale of marijuana.
Dozens of supporters of the bill proposed by the left-wing President Jose Mujica gathered outside the Congress in Montevideo to follow the vote.
Presenting the bill to fellow senators, Roberto Conde said it was an unavoidable response to reality, given that the "war" against drugs had failed.
"We have the duty as the state to give a specific answer to an open territory, small and non-producing," Mr Conde said, adding that Uruguay's borders were used by cartels to smuggle drugs into neighbouring countries.
But many senators also spoke out against the bill, before it was passed by 16 votes to 13.
Opposition lawmaker Alfredo Solari said Uruguay should not "experiment" on its people.
The project had already been approved by Uruguay's lower house in July.
The historic approval comes amid growing debate over drug legalisation in Latin America.
A group of former presidents and influential social figures, including Brazil's Fernando Henrique Cardoso, Mexico's Ernesto Zedillo and Colombian ex-leader Cesar Gaviria, have called for marijuana to be legalised and regulated.
But President Mujica recently asked during an interview why the former leaders only spoke out about the legalisation of marijuana after they had left office.
In July, without naming Uruguay directly, Pope Francis criticised drug legalisation plans during a visit to Brazil.