A woman waves a Canadian flag with a marijuana leaf on it during a rally to celebrate National Marijuana Day in Ottawa in 2016. Canada's Senate passed a law Thursday legalizing recreational marijuana. (Chris Roussakis/AFP/Getty Images)

The Canadian Senate passed legislation Thursday night that would legalize marijuana for recreational use, putting the country one step closer to making Canada the second country to fully legalize the drug.

The Senate approved the measure, 56 to 30, in a late-night vote. It now goes back to the House of Commons with dozens of amendments. Prime Minister Justin Trudeau introduced the legislation last year.

"We are very much focused on the control and legalization of marijuana, because the current system is not working," Trudeau said last month.

Medical marijuana is legal in Canada, and the country is a top exporter of the drug for medical purposes. Canada would become the second country to legalize the production, sale and consumption of marijuana; Uruguay did so last year.

The House of Commons must now vote to accept or reject the amendments before sending the legislation back to the Senate. While the majority of the changes are minor and technical, some are large, including a provision that allows provinces to prohibit people from growing marijuana in their homes. Two provinces, Manitoba and Quebec, plan to prohibit homegrown marijuana. The amendment would make it more difficult for opponents to mount legal challenges.

Sen. Tony Dean, an Independent from Ontario, said Thursday's vote was historic and that the legislation is designed to combat social ills such as high rates of youth consumption and the criminalization of those who possess the drug, particularly young indigenous people.

"We have a government that had the will to try to bring a sophisticated, complex approach to a complex policy challenge," Dean said in an interview. "The government is being clear that this has investments in public health, community health and harm reduction."

The bill has seen opposition from conservative politicians and indigenous leaders who have said the bill could adversely affect Canada's youth.

Sen. Leo Housakos, a conservative from Quebec, said he is concerned that support for the bill amounts to "an attempt to normalize marijuana," something he thinks will have deleterious effects.

"Unfortunately, this bill makes marijuana more accessible to teenagers, particularly, than ever before, and it's very concerning," Housakos told reporters after the vote.

The Canadian Imperial Bank of Commerce has estimated that Canada could see $6.5 billion in legal retail sales by 2020 if the legislation becomes law, equivalent to about $5 billion in U.S. currency. Statistics Canada said that people 15 and older spent $5.7 billion in Canadian currency on marijuana in 2017, even though the drug was illegal recreationally.

Investment from the United States, where recreational marijuana is legal in nine states and the District, has been pouring into Canada ahead of expected legalization. Canada also is taking advantage of the international market by supplying cannabis worldwide, said Jay Czarkowski, founding partner of Canna Advisors, a Colorado-based consulting group.

"Canada is exporting all over the world right now. That should be us," he said of the United States.

correction: An earlier version of this story gave an incorrect figure for the amount that people 15 and older spent on marijuana in Canada last year. It was $5.7 billion, not $5.7 million.