Open this photo in gallery:

Liberal Party candidate Danielle Martin speaks to supporters as they celebrate her winning the by-election 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 one of Monday’s three by-elections.

Liberal candidate Danielle Martin has been declared the winner in University-Rosedale, one of two Toronto ridings up for grabs. Liberal candidate Doly Begum was well in front in Scarborough Southwest with more than 16 per cent of the vote reporting.

Results in a third by-election in the Quebec riding of Terrebonne were too close to call just before 10 p.m. local time.

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 will have a bare majority in the House if they win only a single riding on Monday night, and if they win at least two, they would have full control of the House of Commons.

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.

The Conservatives have already raised concerns about that approach.

“You can bet that one of the first things Liberals will do with a majority will be to use their majority on Committees to shut down opposition efforts to provide transparency and accountability,” Conservative MP Dan Albas said on social media late Monday.

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.