Canada has laid out its plan to legalise the sale of recreational marijuana by June 2018.
If it passes, the country will be the largest developed nation to end marijuana prohibition.
The law was tabled on Thursday, and would allow adults over 18 to possess up to 30g of dried marijuana.
The proposed legislation would allow the federal government to license producers, but provinces would be in charge of regulating consumer sale.
Other issues, such as pricing, taxation and packaging must still be worked out.
"This is a very important day, I've spent most of my adult life keeping children and communities safe," said MP Bill Blair during a press conference shortly after the legislation was presented to parliament.
The former police chief had chaired the government's cannabis task force, which laid out a blueprint for legal recreational pot in Canada.
The government is pitching the legislation as a way to keep pot out of the hands of minors and undercut organised crime.
The law would increase penalties for those who sell to children, and revamp impaired driving laws to make it easier to prosecute people who drive under the influence of drugs or alcohol.
It would allow police to test people's saliva if they think a driver has been using marijuana.
The current legal prohibitions have been an "abject failure" at keeping the children from getting a hold of marijuana, says Public Safety Minister Ralph Goodale.
Trafficking stays illegal
Canada has some of the highest marijuana use in the world, according to the task force, especially amongst young people. About 30% of people aged 20-24 use cannabis.
The new framework would make it illegal to market marijuana products to children, or sell to anyone under 18. Provinces could raise the minimum age of consumption if they choose, the government says.
New laws would also increase the penalty for people who sell to the under-aged, as well as create a new offence for people "exploiting children in the trafficking of cannabis".
Trafficking cannabis outside the government's new legal framework would remain illegal.
Initially, only fresh and dried cannabis, cannabis oils, seeds and plants would be licensed for sale, but adults could grow up to four plants and make edibles at home for their personal use.
Marijuana won't become legal overnight. The government still has to debate the bill and provinces will have to draft their own regulations for sale.
"There's still a lot of questions," said Lynne Belle-Isle, who works for the Centre for Addictions Research.
Ms Belle-Isle participated in the task force's public consultations, and said she's happy with the government's focus on health and safety.
"We agree that legalisation is the way to go, I think criminalisation is a lot more harmful," she said. One thing her organisation has been pushing for is to have the sale of marijuana contained to government-controlled stores that enforce minimum pricing. The system is already used in many provinces for hard alcohol, and she said research shows it cuts down on abuse.
In a report released on Tuesday, the CD Howe Institute warned that if the cost is too high, it would do little to undercut the illicit market, but if it is too low, it could encourage consumption and fail to generate significant government revenue.
Mr Goodale advised that, in the meantime, police will enforce existing marijuana laws.
"This is an orderly transition, not a free-for-all," he admonished.
Illegal pot dispensaries have sprouted up in cities across Canada in the last few years, especially in Vancouver and Toronto.
Many have been regularly raided by police and two prominent marijuana activists and retailers - Marc and Jodie Emery - were recently arrested and charged with a number of offences including drug trafficking.
Medical marijuana has been legal in Canada since 2001 and is grown by 42 federally licensed producers.
The medical marijuana framework would continue to operate under the new legislation, but licensed Canadian producers who grow for the medical marijuana market are already jockeying to enter the lucrative recreational retail sector.