Canada's Prime Minister Justin Trudeau greets commuters at a metro station in Montreal, Tuesday, Oct. 22, 2019. Trudeau won a second term in Canada's national elections Monday, losing the majority but delivering unexpectedly strong results despite having been weakened by a series of scandals that tarnished his image as a liberal icon.  (Sean Kilpatrick/The Canadian Press via AP)

TORONTO (AP) — Prime Minister Justin Trudeau begins his second term facing an increasingly divided Parliament and country, with his rock-star appeal from four years ago diminished by scandal and unmet expectations.

Trudeau was reelected in a stronger-than-expected showing in Monday's national elections. But while his Liberal Party took the most seats in Parliament, it lost its majority and will have to rely on an opposition party to get anything passed.

The prime minister struck a conciliatory note in an early morning address that forced the TV networks to break away from covering his Conservative rival, Andrew Scheer, who had just begun speaking to his own supporters.

"To those who did not vote for us, know that we will work every single day for you, we will govern for everyone," Trudeau said.

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 Trudeau claimed a "clear mandate," his party won fewer raw votes nationally than the Conservatives did 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 Trudeau's inability to get a pipeline built to the Pacific Coast.

"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."

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

In what was supposed to be a concession speech, Scheer said the results showed Trudeau was much weakened since his 2015 election, when pundits had predicted the beginning of another Trudeau dynasty. 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," Scheer said. "And Mr. Trudeau, when your government falls, Conservatives will be ready, and we will win."

Later, at a news conference, Scheer blamed Trudeau for division in the country, accusing him of pitting region against region.

"We have a divided country. It is essential for Justin Trudeau to take this seriously, to try to find common ground and stop attacking the energy sector," Scheer said. He said he will continue as Conservative leader.

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, however, didn't talk about separatism during the campaign and is not expected to seek a referendum on independence from Canada.

Trudeau, 47, prevailed after a series of scandals that tarnished his image as a liberal icon.

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

Also, 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.

"I'm surprised at how well Trudeau has done," Nelson Wiseman, a political science professor at the University of Toronto, said of the election results. "I don't think anybody expected Trudeau to get a majority, but they are not that far off."

Trudeau's Liberals are likely to rely on the New Democrats to form a new government. That will further alienate Western Canada because New Democrat leader Jagmeet Singh is against the pipeline project.

"If the frustration and alienation continue to mount it will pose a very serious challenge to national unity," Alberta Premier Jason Kenney warned. "I'm not going to let Justin Trudeau push me out of my country."

Singh disputed the notion the results show a broken Canada. More than 63 percent of Canada's voters chose progressive parties.

"The people in a lot of ways share so many values," Singh said.

Liberal leader Justin Trudeau and wife Sophie Gregoire Trudeau wave as they go on stage at Liberal election headquarters in Montreal, Monday, Oct. 21, 2019. (Ryan Remiorz/The Canadian Press via AP)
Canadian Prime Minister Justin Trudeau, center right, poses with commuters at a metro station in Montreal, Tuesday, Oct. 22, 2019. Trudeau won a second term in Canada's national elections Monday, losing the majority but delivering unexpectedly strong results despite having been weakened by a series of scandals that tarnished his image as a liberal icon. (Sean Kilpatrick/The Canadian Press via AP)
Conservative leader Andrew Scheer speaks at Conservative election headquarters in Regina, Saskatchewan, on Monday, Oct. 21, 2019. (Jeff McIntosh/The Canadian Press via AP)
Liberal Leader Justin Trudeau takes the stage at Liberal election headquarters n Montreal, on Tuesday, Oct. 22, 2019. (Paul Chiasson/The Canadian Press via AP)
Liberal leader Justin Trudeau celebrates with his wife, Sophie Gregoire, after winning a minority government at the election night headquarters Tuesday, Oct. 22, 2019 in Montreal. (Ryan Remiorz/The Canadian Press via AP)
Liberal supporters react as poll numbers come in at Liberal election headquarters in Montreal on Monday Oct. 21, 2019. (Sean Kilpatrick/The Canadian Press via AP)
Supporters react as results are shown at the Conservative headquarters in Regina, Saskatchewan, Monday, Oct. 21, 2019. (Adrian Wyld/The Canadian Press via AP)
New Democratic Party leader Jagmeet Singh and his wife Gurkiran Kaur watch the Canadian election results come in at his hotel room in Burnaby, British Columbia, Monday, Oct. 21, 2019. (Nathan Denette/The Canadian Press via AP)
Liberal party supporters celebrate at the election party headquarters in Montreal, Monday, Oct.21, 2019. (Sean/The Canadian Press via AP)
Liberal leader Justin Trudeau celebrates with his wife, Sophie Gregoire Trudeau, after winning a minority government at the election night headquarters Tuesday, Oct. 22, 2019 in Montreal. (Ryan Remiorz/The Canadian Press via AP)
Liberal Leader Justin Trudeau delivers his speech in Montreal, on Tuesday, Oct. 22, 2019. (Paul Chiasson/Pool Photo via AP)
Liberal leader Justin Trudeau celebrates with his wife, Sophie Gregoire Trudeau, after winning a minority government at the election night headquarters Tuesday, Oct. 22, 2019 in Montreal. (Ryan Remiorz/The Canadian Press via AP)