Prime minister Justin Trudeau has won a second term in a stronger-than-expected showing in Canada’s national elections, claiming a “clear mandate” despite a parliament and nation increasingly fractured along regional lines.

His Liberal Party took the most seats in parliament but lost its majority in Monday’s ballot, which means it will have to rely on an opposition party to pass legislation.

The prime minister’s early morning address to supporters came as his Conservative rival, Andrew Scheer, had just begun speaking to his own backers, forcing TV networks to break away from Mr Scheer.

But the prime minister struck a conciliatory note: “To those who did not vote for us, know that we will work every single day for you, we will govern for everyone.”

With results still trickling in, the Liberals had 157 seats — 13 short of the 170 needed for a majority in the 338-seat House of Commons — while the Conservatives had 121.

While Mr Trudeau claimed a mandate, his party won fewer votes nationally than the Conservatives, and failed to win a single seat in the western provinces of Alberta and Saskatchewan, where the Conservatives dominated.

There is growing outrage in Alberta, home to the third-largest oil reserves in the world, over Mr Trudeau’s inability to get a pipeline built to the Pacific Coast so the province’s oil can command a higher price.

“To Canadians in Alberta and Saskatchewan,” he said after his victory, “know that you are an essential part of our great country. I have heard your frustration, and I want to be there to support you. Let us all work hard to bring our country together.”

Justin Trudeau and wife Sophie Gregoire-Trudeau celebrate in Montreal
Justin Trudeau and wife Sophie Gregoire-Trudeau celebrate in Montreal (Sean Kilpatrick/Canadian Press/AP)

At the same time, he said Canadians elected a progressive government that will fight climate change. That means he will keep a national carbon tax that has also angered western Canada.

In what was supposed to be a concession speech, Mr Scheer said the results showed the PM was much weakened since his 2015 election, when pundits had predicted the beginning of another Trudeau dynasty.

Mr Trudeau’s father Pierre was prime minister from 1968 to 1984, apart from a brief interruption in 1979-80.

“Conservatives have put Justin Trudeau on notice,” Mr Scheer said. “And Mr Trudeau, when your government falls, Conservatives will be ready, and we will win.”

Andrew Scheer
Andrew Scheer (Adrian Wyld/Canadian Press/AP)

Canada was also further divided by the electoral success of the separatist Bloc Quebecois in the French-speaking province of Quebec. The Bloc won 32 of the province’s 78 districts, up from 10.

The party did not talk about separatism during the campaign and is not expected to seek a referendum for independence from Canada.

Mr Trudeau, 47, prevailed after a series of scandals that diminished his rock-star appeal from 2015 and tarnished his image as a liberal figurehead.

Old photos of him in blackface and brownface surfaced last month, and he was also accused of bullying his female attorney general into dropping the prosecution of a Canadian engineering company.

Environmentalists have accused him of betrayal for spending billions to buy the pipeline in a so-far unsuccessful bid to get the stalled project moving again. It has been held up by environmental opposition and court challenges.

His party is likely to rely on the New Democrats to form a new government and pass legislation. That will further alienate western Canada because New Democrat leader Jagmeet Singh is against the pipeline project.