TORONTO (AP) — Canadian Prime Minister Justin Trudeau’s government introduced legislation Thursday to let adults possess 30 grams of marijuana in public — a measure that would make Canada the largest developed country to end a nationwide prohibition on recreational marijuana.

Trudeau has long promised to legalize recreational pot use and sales. U.S voters in California, Massachusetts, Maine and Nevada voted last year to approve the use of recreational marijuana, joining Colorado, Washington, Oregon and Alaska.

The South American nation of Uruguay is the only nation to legalize recreational pot.

The proposed law allows four plants to be grown at home. Those under 18 found with small amounts of marijuana would not face criminal charges.

Officials said Canadians should be able to smoke marijuana legally by July 1, 2018. The federal government set the age at 18, but is allowing each of Canada’s provinces to determine if it should be higher. The provinces will also decide how the drug will be distributed and sold. The law also defines the amount of THC in a driver’s blood, as detected by a roadside saliva test, that would be illegal. Marijuana taxes will be announced at a later date.

The Canadian government closely followed the advice of a marijuana task force headed by former Liberal Health Minister Anne McLellan. That panel’s report noted public health experts tend to favor a minimum age of 21 as the brain continues to develop to about 25, but said setting the minimum age too high would preserve the illicit market.

Canadian youth have higher rates of cannabis use than their peers worldwide.

“If your objective is to protect public health and safety and keep cannabis out of the hands of minors, and stop the flow of profits to organized crime, then the law as it stands today has been an abject failure,” Public Safety Minister Ralph Goodale told a news conference. “Police forces spend between $2 billion and $3 billion every year trying to deal with cannabis, and yet Canadian teenagers are among the heaviest users in the western world … We simply have to do better.”

Goodale said they’ve been close touch with the U.S. government on the proposed law and noted exporting and importing marijuana will continue to be illegal.

“The regime we are setting up in Canada will protect our kids better and stop the flow of illegal dollars to organized crime. Our system will actually be the better one,” Goodale said

Former Toronto Police Chief Bill Blair, who is the parliamentary secretary to the justice minister, said officials learned from the experiences from other jurisdictions like Colorado and Washington state.

While the government moves to legalize marijuana, retail outlets selling pot for recreational use have already been set up. Trudeau has emphasized current laws should be respected. Police in Toronto, Vancouver and other cities raided stores earlier last month and made arrests.

The news that Canada was soon going to announce the law was noticed online last month by Snoop Dogg , who tweeted “Oh Canada!” Canadian folk singer Pat Robitaille released a “Weed song” to coincide with the government’s announcement.

Copyright 2017 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.