A Canadian flag with a marijuana leaf on it is seen during the annual 4/20 marijuana rally on Parliament Hill in Ottawa, Ontario. File picture: Chris Wattie/Reuters

Montreal - The Canadian Senate voted on Tuesday to approve landmark legislation legalizing the recreational use of marijuana and clearing the way for a fully legal market of the drug within the next two to three months.

The upper house passed the bill by a vote of 52 to 29, with two abstentions, despite strong opposition by Conservative senators.

"It's been too easy for our kids to get marijuana - and for criminals to reap the profits," Prime Minister Justin Trudeau tweeted minutes after the vote. "Today, we change that. Our plan to legalize & regulate marijuana just passed the Senate."

Initially, Trudeau's Liberal government had planned for the bill to be passed by both houses of parliament in time for retail sales to begin by July 1.

However, that timeline was pushed back after the proposed legislation encountered fierce resistance in the Senate, which added four-dozen amendments before sending it back to the House of Commons.

The Liberal-controlled lower house rejected some of the amendments suggested by unelected senators and passed the laws back to the Senate.

Now that the bill has passed, it is expected to receive royal assent as early as Wednesday to formally become law.

The legislation comes with a provisional buffer period of eight to 12 weeks to give Canada's 10 provinces and three northern territories time to prepare for actual sales of recreational marijuana.

The legislation allows individuals aged 18 and older to grow four marijuana plants in their own home for personal use and establishes a public possession limit of 30 grams of dried cannabis.