It makes Canada the first G7 country to legalise the drug's recreational use and the second to have a nationwide, legal marijuana market, after Uruguay. The new legislation could see marijuana sold legally in shops as early as September.
Conservative MP Marilyn Gladu said the Liberal Party's priority should be ironing out problems with the implementation of a legal recreational marijuana market.
Marijuana became illegal in Canada in 1923, but its use for medical purposes was legalized in 2001.
California, home to one in eight Americans, launched the United States' biggest legal marijuana marketplace on January 1.
Ontario Senator Tony Dean, who sponsored the bill, enthused over the result, suggesting the move has the power to transform Canadian society.
Those ages are lower than in USA states that have embraced legalization.
The government's companion legislation on impaired driving is also expected to pass soon, said Justice Minister Jody Wilson-Raybould, but she added that driving under the influence of drugs has always been - and will remain - against the law in Canada.
The measure ends prohibition of cannabis that had been in place in Canada since 1923. Transformative social policy, I think.
The move by Canada is likely to cause a headache south of the border, and twist an already strained relationship with the current USA government.
'Now we can start to tackle some of the harms of cannabis.
USA federal law prohibits the cultivation, sale and use of marijuana. These are good things for Canada'.
"It is our hope as of October 17 there will be a smooth operation of retail cannabis outlets operated by the provinces with an online mail delivery system operated by the provinces that will ensure that this happens in an orderly fashion", Trudeau said. "We're keeping our promise to change that, with our plan to legalize and regulate marijuana".
As the first major economy to fully legalize cannabis, Canada's regulatory rollout will be closely watched by other nations considering the same path - and by global investors, who have already poured billions into Canadian marijuana firms.
However, some health experts have anxious that the lower age will encourage use of a substance that can have long-term consequences on still-maturing brains.
Many countries have decriminalised the use and possession of cannabis, abandoning prison sentences for consumers, but only a handful have gone as far as legalising its cultivation and use.