OTTAWA -- The Senate gave approval in principle Thursday evening to the federal government's bill to legalize recreational marijuana, after a tense few days of manoeuvring by Conservative senators hoping to derail one of Prime Minister Justin Trudeau's signature election promises.

Bill C-45 passed at second reading by a vote of 44-29.

That does not mean the bill is out of the Senate woods, however. It will now be scrutinized by five different Senate committees, which could recommend amendments, before returning it to the upper house for a final debate and vote by June 7.

Thursday's vote came hours after Trudeau issued a veiled warning to senators that they should not attempt to thwart the will of Canadians or the government they elected on a platform that included legalization of cannabis.

His warning reflected concern among Liberals that the bill might not survive second reading -- a concern triggered by Conservative senators, who were hoping to deliver a double-barrelled embarrassment to Trudeau: upending his promise to legalize marijuana while demonstrating the folly of his efforts to reform the Senate into a less partisan, more independent chamber.

Ordinarily, approval in principle, known as a second reading vote, is not a big hurdle and is dispensed with on the basis of a quick voice vote so that a bill can be sent to committee.

But, in the case of C-45, the 33 Conservative senators vowed to vote as a bloc against the bill and signalled their intention to insist upon a standing vote, where each senator's vote is counted.

Although the Conservatives no longer dominate the 105-seat upper house, they had evidently hoped a handful of independent senators would join them and that -- combined with a large number of absent independents who were travelling on Senate committee business -- would be enough to defeat the bill.

The leadership of the independent senators group scrambled to avoid that outcome, sending a memo Wednesday urging all of its absent members to return to Ottawa in time for the vote and warning that the Conservatives would blame the independents if the bill was defeated.

The vast majority of independents did make it back in time and all of them voted as a bloc, along with unaffiliated and Liberal independent senators, to send the bill to committee.

Conservative whip, Sen. Don Plett, said that proves the independents really make up a partisan caucus that's whipped to do the government's bidding, whereas he called the Conservatives "the most independent caucus" even though they too voted as a bloc.

That said, Plett also predicted that some of the independents will ultimately support amendments to the bill or even vote against it.

Sen. Yuen Pau Woo, the leader of the independent senators' group, said it's "not extraordinary at all" that all independents would vote to send the bill for thorough scrutiny by committees, which he characterized as doing their constitutional duty to give legislation sober second thought. But he too said that doesn't mean they'll all necessarily support the bill in the end, at least not as currently drafted.

"I fully expect that senators from different sides will discuss amendments and that these will be considered seriously by the various committees," he said.

Sen. Peter Harder, the government's representative in the Senate, also acknowledged that the bill still faces some potentially big hurdles.

"This is a bill of high interest to the Senate. There are many issues to be dealt with," he said.

Prior to the vote, Conservative Senate leader Larry Smith said if the bill was defeated, it would be because Trudeau's reforms mean the government can no longer rely on senators appointed by the prime minister to support government legislation; it wouldn't be because of partisan games played by the Conservatives.

"It has nothing to do with partisanship," Smith insisted.

"It has everything to do with Sen. Harder, as the government representative, trying to implement Prime Minister Trudeau's new system, which has holes in it. ... They have to get their troops organized to make sure they get the vote they want."

Smith outlined five key areas of concern to Conservative senators about the cannabis bill: its impact on young people, public security and Indigenous people, the absence of a public education campaign and the lack of police preparedness to enforce a legalized pot regime, including the absence of a scientific test for drug impaired driving.

One Conservative senator, Pierre-Hugues Boisvenu, bluntly described the bill as a "piece of s---." He later apologized for his choice of words.

Earlier in the day, Trudeau said he expects the unelected Senate to scrutinize and suggest improvements to bills passed by the House of Commons. But he reminded senators that Canadians voted to end the criminal prohibition on cannabis when they elected his Liberal government.

"It is very clear that this bill responds first to an electoral promise that we made very clearly during the election campaign and for which Canadians voted," he said following an event in New Brunswick.

The criminal cannabis regime has not protected Canadian kids, who are among the highest under-age users of marijuana in developed countries, and has put up to $7 billion every year in the pockets of organized crime, Trudeau said.

"The current system does not work. ... This is not something that Canadians want to see continued."