Canada has legalised the use of recreational marijuana nationwide, making it the first G7 country to do so.

The Senate voted 52-29 on Tuesday to pass the Cannabis Act, which allows people over the age of 18 to grow, buy, and use the drug for recreational purposes. It also regulates the growth and sale of marijuana, putting strict limits on packaging and limiting home growth to four plants at a time.

The bill passed the House of Commons earlier on Tuesday, and now goes to Prime Minister Justin Trudeau – an outspoken supporter of the legalisation effort – to decide when it will take effect.

The vote makes Canada the second country to legalise recreational marijuana nationwide, after Uruguay. It is the first of the world's seven most advanced economies – also known as the G7 – to do so.

Nine US states allow for recreational use, and several other G7 nations allow it for medical purposes. Medical marijuana has been legal in Canada since 2001.

In pictures: 4/20 Marijuana world rallies Show all 26 1 /26 In pictures: 4/20 Marijuana world rallies In pictures: 4/20 Marijuana world rallies A man wears a marijuana leaf mask during the annual 4/20 cannabis culture celebration at Sunset Beach in Vancouver, British Columbia AP In pictures: 4/20 Marijuana world rallies A lady smokes marijuana on Parliament Hill on 4/20 in Ottawa, Ontario Getty Images In pictures: 4/20 Marijuana world rallies James Reed smokes a joint during the Denver 420 Rally at Civic Center Park in Denver, Colorado Getty Images In pictures: 4/20 Marijuana world rallies People sign a 4/20 sign on Parliament Hill on in Ottawa, Ontario Getty Images In pictures: 4/20 Marijuana world rallies A woman smokes marijuana on Parliament Hill on 4/20 in Ottawa, Ontario. Polling released showed strong support in Canada for a government drive to legalise recreational use of marijuana, but many would like the proposed minimum age for consumption to be raised. Sixty-three percent of respondents told the Angus Reid Institute they support legalisation Getty Images In pictures: 4/20 Marijuana world rallies A man smokes marijuana during the annual 4/20 marijuana rally on Parliament Hill in Ottawa, Ontario, Canada Reuters In pictures: 4/20 Marijuana world rallies Demonstrators smoke marijuana during the '4/20 Santiago' rally in favour of legalisation in front of the La Moneda presidential palace in Santiago, as part of the Global Marijuana March which is being held in hundreds of cities worldwide Getty Images In pictures: 4/20 Marijuana world rallies People play with a mock marijuana joint during a 4/20 party to demand legalisation and to celebrate marijuana culture outside the Senate building in Mexico City, Mexico Reuters In pictures: 4/20 Marijuana world rallies Adam Eidinger, co-founder of DCMJ, hands out free marijuana joints to DC residents who worked on Capitol Hill as part of the 1st Annual Joint Session to mark '4/20' day and promote legalising marijuana on Capitol Hill in Washington, DC Getty Images In pictures: 4/20 Marijuana world rallies In pictures: 4/20 Marijuana world rallies Police arrest Rachel Ramone Donlan after she handed out free marijuana joints to DC residents who worked on Capitol Hill as part of the 1st Annual Joint Session to mark '4/20' day and promote legalising marijuana on Capitol Hill in Washington, DC AFP/Getty Images In pictures: 4/20 Marijuana world rallies Police arrest Rachel Ramone Donlan after she handed out free marijuana joints to DC residents who worked on Capitol Hill as part of the 1st Annual Joint Session to mark '4/20' day and promote legalising marijuana on Capitol Hill in Washington, DC Getty Images In pictures: 4/20 Marijuana world rallies Thousands of people gather to smoke marijuana during the '420 Santiago'rally in front of the La Moneda presidential palace in Santiago Getty Images In pictures: 4/20 Marijuana world rallies People attend the Denver 420 Rally at Civic Center Park in Denver, Colorado Getty Images In pictures: 4/20 Marijuana world rallies Kevin Barron and Lasean Moore of Raleigh, North Carolina, share a joint during the Denver 420 Rally at Civic Center Park in Denver, Colorado Getty Images In pictures: 4/20 Marijuana world rallies Nic Ruhl takes a pull on a giant hand rolled joint at precisely 4:20pm MDT during the Denver 420 Rally at Civic Center Park in Denver, Colorado Getty Images In pictures: 4/20 Marijuana world rallies Various cannabis paraphernalia on display at a vendor's stall during the Denver 420 Rally at Civic Center Park in Denver, Colorado Getty Images In pictures: 4/20 Marijuana world rallies Mo Banez, of Austin, Texas, lights a joint during the Denver 420 Rally at Civic Center Park in Denver, Colorado Getty Images In pictures: 4/20 Marijuana world rallies A man displays a large container of cannabis during the Denver 420 Rally at Civic Center Park in Denver, Colorado. The rally, held annually, is a celebration of both the legalisation of cannabis and cannabis culture. Colorado is one of twenty-six U.S. states along with the District of Columbia that has legalised the use of cannabis either recreationally or medically AFP/Getty Images In pictures: 4/20 Marijuana world rallies Sitting in small groups on mats shaded by trees in the Rose Garden just across from the Knesset, participants lit up as the clock struck 4:20 for the local version of the traditional worldwide April 20 pro-marijuana events, known as '420' rallies Getty Images In pictures: 4/20 Marijuana world rallies An Israeli smokes a marijuana joint in Jerusalem during a rally at the Rose garden Getty Images In pictures: 4/20 Marijuana world rallies Sitting in small groups on mats shaded by trees in the Rose Garden just across from the Knesset, participants lit up as the clock struck 4:20 for the local version of the traditional worldwide April 20 pro-marijuana events, known as '420' rallies Getty Images In pictures: 4/20 Marijuana world rallies An Israeli girl poses with a mock marijuana joint in Jerusalem during a rally at the Rose garden, to celebrate 420 and to express their defiance of current laws Getty Images In pictures: 4/20 Marijuana world rallies aelis pass around a marijuana joint in Jerusalem during a rally at the Rose garden, to celebrate 420 and to express their defiance of current laws Getty Images In pictures: 4/20 Marijuana world rallies An Israeli smokes a marijuana joint in Jerusalem during a rally at the Rose garden, to celebrate 420 and to express their defiance of current law Getty Images In pictures: 4/20 Marijuana world rallies An Israeli smokes a marijuana joint in Jerusalem on April 20, 2017 during a rally opposite the Knesset to celebrate 420 and express defiance of current laws AFP/Getty Images

Senator Tony Dean, the bill's sponsor in the Senate, called the vote a "brave move on the part of the government" and said he was "feeling just great".

"We've just witnessed a historic vote for Canada," he told CBC. "The end of 90 years of prohibition. Transformative social policy, I think."

Provinces will have a buffer period of at least eight to 12 weeks to prepare for sales before the law takes affect. The government had hoped to get the law passed in time for sales to start on 1 July, but pushed back the vote after the Senate requested more time to review it.

4/20 London - Should marijuana be legal?

The law bans possession of more than 30g of dried marijuana, and outlaws personal sales of the drug. Driving under the influence of marijuana will also be punishable by a $1,000 fine for a first offence, and jail time for a second.

The finer points of legalisation will be handled at a provincial level. Laws are expected to vary on issues like home growth and smoking in public.

The country's health ministry has said it hopes the law will make Canadians safer by restricting minors' access to the drug and disrupting the black market. The ministry came out in favour of the bill in a strong statement last April, saying the government's "current approach to cannabis does not work".

The bill's authors also claimed it would allow for better quality control and more public health awareness campaigns. Mr Trudeau has said legalisation would "deprive organised crime of money [and] make access more difficult for our children".

Several conservative politicians, however, disagreed.