Canada is to become the second country in the world to fully legalise marijuana, after the senate approved legislation paving the way for recreational cannabis to be legally bought and sold within the next two or three months.

“We’ve just witnessed a very historic vote that ends 90 years of prohibition,” senator Tony Dean told reporters on Tuesday after the vote to pass the Cannabis Act.

“It ends 90 years of needless criminalisation, it ends a prohibition model that inhibited and discouraged public health and community health in favour of just-say-no approaches that simply failed young people miserably.”

The federal government has said it would give provinces and territories – which are responsible for deciding how recreational cannabis will be distributed and sold – eight to 12 weeks after the legislation is passed to get ready for sales, but the exact date that sales begin will be set by the federal government.

On Tuesday, the prime minister welcomed the legislation being passed. “It’s been too easy for our kids to get marijuana - and for criminals to reap the profits,” he wrote on Twitter. “Today, we change that.”

Initially, the government planned to begin retail sales by 1 July, but the timeline was delayed as the senate debated the legislation. Canada’s upper chamber voted 52 to 29 on Tuesday to make marijuana fully legal in the country.

Some Conservative MPs and senators voiced their disappointment as the bill passed on Tuesday. “Sad day for Canada’s kids,” senator Linda Frum wrote on Twitter.

Conservative senator Leo Housakos said: “When you normalise the use of marijuana and you’re a young person and you had certain reservations because of the simple fact that it was illegal, there’s, I believe, a propensity to have somebody be more inclined to use it.”

Once legalisation goes into effect, Canadians will be able grow up to four plants in their own home and carry up to 30 grams of dried cannabis for personal use. Those caught with more than this amount, or who supply marijuana to minors will face penalties.

Sales of cannabis – which analysts estimate could eventually be worth somewhere between C$5bn and C$7bn annually – will vary widely across the country. In Alberta, recreational cannabis will be available at more than 200 private retailers while in New Brunswick, the provincial government will operate a chain of stores called Cannabis NB.

The minimum age of consumption will fluctuate between 18 or 19 years depending on the province.

On Tuesday, supporters of the legislation stressed the cautious, prudent approach to the landmark change. “What the government’s approach has been is, yes, legalisation but also strict control,” said Peter Harder, the government’s representative in the Senate. “That does not in any way suggest that it’s now party time.”

I served 20 years for cannabis. Now the police are cashing in on it | Rosie Rowbotham

Nearly 400,000 people a day cross the border between Canada and the US. Since 2016, Canada has been pushing the US to change a policy that bans Canadians who admit to having used marijuana from travelling to the United States.