Open this photo in gallery:

Liberal Party candidate Danielle Martin celebrates winning the byelection for the riding of University–Rosedale, in Toronto on Monday.Chris Young/The Canadian Press

Prime Minister Mark Carney’s Liberals have secured a majority government, winning at least two of Monday’s three by-elections and full control of the House of Commons.

Liberal candidate Danielle Martin is projected to win in University-Rosedale, while Liberal candidate Doly Begum has been declared the winner in Scarborough Southwest with more than half of polls reporting in those ridings.

Results in a third by-election in the Quebec riding of Terrebonne were too close to call. As of just after 10 p.m. local time, the Liberal candidate Tatiana Auguste had a very narrow lead over Bloc Québécois candidate Nathalie Sinclair-Desgagné after counting more than 30 per cent of the ballots.

Polls closed in the three federal by-elections at 8:30 p.m.

The Liberals headed into Monday’s races with 171 seats in the House of Commons – a roster that includes five MPs who have crossed the floor from the opposition benches to the government side since November.

Mr. Carney and the Liberals needed to win just one riding Monday night to secure a bare majority. Winning at least two allows them to have full control of the House of Commons without needing to rely on the Speaker to break tie votes.

The Toronto seats – University-Rosedale and Scarborough Southwest – are long-time Liberal strongholds, while the Montreal-area seat of Terrebonne switched from Bloc Québécois to Liberal last year by a single vote. The Supreme Court overturned the result in February, prompting the by-election there, while in the Toronto ridings, both candidates stepped down for other jobs.

Mr. Carney won a minority mandate in the federal election last spring, finishing just three seats shy of a majority.

A combination of floor-crossers and by-elections turning a minority government into a majority has never happened before in Canada. The most recent majority government was in 2015 when Justin Trudeau first led the Liberals to victory; they were reduced to a minority four years later.

Despite controlling a minority of seats in the House, Mr. Carney’s government has been able to pass legislation, including a budget last fall, and has survived several confidence motions with the help of opposition parties.

An early first step for the Liberals would be to gain control over committees in the House of Commons; they are currently outnumbered by opposition MPs and with a majority they will seek to change that, allowing them to control the agenda and get legislation through faster.

Conservatives raised concerns about that approach, warning that a Liberal majority on House of Commons committees will shut down opposition efforts to provide transparency.

Conservative Leader Pierre Poilievre pledged Monday night that he would continue to fight for people in Parliament and in the next election.

“The Carney government did not win a majority government through a general election or today’s by-elections,” he said in a statement. “Instead, it was won through backroom deals with politicians who betrayed people who voted for them.”

Though the Liberals have obtained opposition support for parts of their agenda, the Carney government struggled to move much of it through Parliament in its first year. While it has introduced 26 government bills in the House of Commons, only 11 have received royal assent and five of those were bills to approve routine spending. Mr. Carney has repeatedly promised to cut red tape and get big projects built, but many of the projects identified by the government as priorities have not yet started.

The Liberals currently enjoy a commanding lead in public-opinion polls. The latest Nanos Research survey has the Liberals well in front at 45-per-cent support, followed by 32 per cent for the Conservatives and 12 per cent for the NDP.

The pollster’s tracking of whom Canadians prefer as prime minister has Mr. Carney at 52 per cent, while only 24 per cent chose Conservative Leader Pierre Poilievre.

The Nanos survey is based on random interviews with 1,027 Canadian adults using a four-week rolling average of 250 respondents each week. The most recent surveys were collected up to April 10.

Of the five floor-crossers, one was an NDP MP and four were Conservatives, a blow to Mr. Poilievre. He’s been asked repeatedly whether he can stay on as leader and has insisted his leadership is secure.

The Globe and Mail has previously reported the Liberals are courting up to eight others from both the Conservatives and NDP.

The Supreme Court ruling in February paved the way for a rematch in the Quebec riding of Terrebonne between Liberal candidate Tatiana Auguste and Bloc candidate Nathalie Sinclair-Desgagné, who was the incumbent heading into the general election.

The court’s decision was in response to concerns that a voter in the riding had said she had cast her ballot for the Bloc by mail, but that her ballot was returned to her because of an error in the postal code of the polling station.

Bloc MP Rhéal Fortin told reporters Monday he thinks his party has a good chance at victory, but he’s not a pollster.

“If we just look at the comments that we get on the ground over there, everybody agrees that Bloc Québécois should be there to defend the people from Terrebonne,” he said.

Scarborough Southwest became vacant after Mr. Carney appointed veteran Liberal MP and former cabinet minister Bill Blair to be Canada’s next high commissioner to the United Kingdom.

The Liberals recruited Doly Begum, the former deputy leader of the Ontario New Democrats, as the party’s candidate. Middle-school teacher Diana Filipova is the Conservative candidate and community advocate Fatima Shaban is running for the NDP.

The opening in University-Rosedale was created by the departure of former deputy prime minister and Liberal MP Chrystia Freeland. She is now a volunteer adviser to Ukrainian President Volodymyr Zelensky, chief executive officer of the Rhodes Trust and a media contributor to Bloomberg News.

The Liberal candidate, Danielle Martin, is a family doctor and health care advocate. Don Hodgson is running for the Conservatives and the NDP candidate is Serena Purdy.