OTTAWA — Justin Trudeau remains prime minister but the Liberals will need the support of at least one party to govern a country that emerged bitterly divided from a bruising 40-day election campaign.
With results still pouring in late Monday, the Liberals had 157 seats — 13 short of the 170 needed for a majority in the 338-seat House of Commons.
A resurgent Bloc Quebecois scooped up 32 seats, dashing Liberal hopes of making gains in Quebec that could have ensured a second consecutive majority mandate.
Despite a strong campaign by NDP Leader Jagmeet Singh, his party was leading or elected in just 23 seats and nearly wiped out in Quebec, the province that only eight years ago delivered an orange wave that pushed the NDP into official Opposition status for the first — and so far, only— time.
Nevertheless, Monday's result leaves the NDP potentially in the driver's seat, holding the balance of power.
Trudeau, whose Liberals entered the campaign with 177 seats, will need the support of either the NDP or the Bloc to command the confidence of the House of Commons, the first test of which will come within weeks on a throne speech to open a new session of Parliament.
And that could well exacerbate divisions that worsened over the course of the campaign and were apparent in the Liberals' being shut out entirely in Alberta and Saskatchewan. The two oil-producing provinces went solid blue, delivering every seat to the Conservatives.
Indeed, the Conservatives were slightly ahead in the popular vote overall. But with so much of their vote concentrated in the two western provinces, the party fell short of the Liberals' tally, taking just 121 ridings.
Singh has signalled the NDP will fight plans to expand the Trans Mountain Pipeline to carry Alberta oilsands crude to the British Columbia coast, en route to overseas markets. Trudeau's government purchased the pipeline for $4.5 billion to ensure the expansion project would proceed, a decision that cost the Liberals support among progressive voters.
The Liberals owed their lead over the Tories largely to Ontario. The country's largest province delivered 79 seats to the Liberals, compared to 36 for the Conservatives and just six for the NDP.
In Quebec, the Liberals were down to 35 seats, just ahead of the Bloc Quebecois with 32. The Conservatives were leading in 10 and NDP in one.
The Liberals also dominated in Atlantic Canada. Early results had the Liberals leading in 24 of the region's 32 ridings, the Conservatives in six, the NDP in one and, in something of a surprise, the Greens in one: Fredericton.
Five Liberal cabinet ministers in the Atlantic region headed for re-election: Newfoundland and Labrador's Seamus O'Regan, New Brunswick's Dominic LeBlanc and Ginette Petitpas Taylor, Nova Scotia's Bernadette Jordan and Prince Edward Island's Lawrence MacAulay.
However, Diane Lebouthillier in Quebec's Gaspesie-Les-Iles-de-la-Madeleine, where polls closed earlier than in the rest of the province, was in a tight race against the Bloc Quebecois's Guy Bernatchez. Veteran minister Ralph Goodale went down in Regina, as did Amarjeet Sohi in Edmonton.
The Green party, which had hoped for a big breakthrough in this election, had three seats, up just one.
Maxime Bernier, leader of the fledgling People's Party of Canada, lost his own Quebec seat in Beauce.
Neither Trudeau nor Scheer seemed able to generate much enthusiasm throughout the campaign, which frequently devolved into mudslinging and misrepresentations of one another's policies and records.
Trudeau, who had barely recovered from months of controversy over the SNC-Lavalin affair last winter and spring, was embarrassed during the opening week of the campaign when it was revealed that he had at least three times in the past dressed up in black- or brownface. The revelation undercut his image as a champion of diversity and inclusion.
He was also plagued with unsubstantiated rumours and fake reports, spread on social media, about his conduct as a teacher at a Vancouver private school.
Scheer was dogged throughout the campaign by questions about his personal beliefs about abortion and same-sex marriage and repeatedly insisted that he would not reopen debate on either issue should he become prime minister. However, doubt remained whether he would allow Conservative backbenchers to initiate legislation to restrict access to abortions.
Conservative hopes in Quebec took a beating after Scheer put in what was widely considered a bad performance in the first French-language leaders' debate. And in the dying days of the campaign, he was hit with reports that his party had hired an outside consulting firm to conduct a "seek and destroy" campaign against Bernier, Scheer's one-time leadership rival.
11:40 p.m. update:
OTTAWA — Justin Trudeau is expected to remain prime minister but the Liberals may need the support of one or more opposition parties to govern.
The Liberals are elected or leading in 144 ridings across the country — 26 short of the 170 seats needed for a majority in the 338-seat House of Commons.
Andrew Scheer's Conservatives are leading or elected in 105 ridings, while the NDP has 18 and the Greens one.
Some ridings, especially in British Columbia, have yet to report any results and others have reported only a few polls' worth.
But it appears that Trudeau will at least have a shot at a second mandate, with a minority government.
He'll be doing it without a key lieutenant, however: veteran MP Ralph Goodale, a longtime fixture of the federal Liberal benches in the House of Commons, was headed for defeat at the hands of Conservative rival Michael Kram.
The Liberals are showing strength in the two central Canadians provinces that account for almost 60 per cent of the seats up for grabs.
In Quebec, the Liberals are leading in 34 ridings, just ahead of the Bloc Quebecois with 33. The Conservatives are leading in nine and the NDP in two.
And in Ontario, the Liberals are leading in 41 ridings, to the Conservatives' 29 and NDP's 10.
The Liberals also dominated early returns in Atlantic Canada. While the Liberals got off to a good start in the four Atlantic provinces, it's not quite the sweep that painted the entire region red in 2015.
Early results had the Liberals leading in 24 of the region's 32 ridings, the Conservatives in six, the NDP in one and, in something of a surprise, the Greens in one: Fredericton.
The Liberals had never expected to repeat their 2015 sweep of Atlantic Canada. But they couldn't afford to sustain many losses and hold onto power.
Polls suggested that the Liberals and Andrew Scheer's Conservatives finished the 40-day campaign in a dead heat, with neither in position to win a majority of seats in the House of Commons.
So far, it appears that five Liberal cabinet ministers in the Atlantic region are headed for re-election: Newfoundland and Labrador's Seamus O'Regan, New Brunswick's Dominic LeBlanc and Ginette Petitpas Taylor, Nova Scotia's Bernadette Jordan and Prince Edward Island's Lawrence MacAulay.
However, Diane Lebouthillier in Quebec's Gaspesie-Les-Iles-de-la-Madeleine, where polls closed earlier than in the rest of the province, was in a tight race against the Bloc Quebecois's Guy Bernatchez.
The Liberals are ahead in six of the seven ridings in Newfoundland and Labradoer. In the seventh, St. John's East, former New Democrat MP Jack Harris defeated Liberal Nick Whalen.
The Liberals are also leading in all four of P.E.I.'s ridings.
In New Brunswick, the Liberals are ahead in five ridings, the Tories in four, while Green candidate Jenica Atwin is leading in Fredericton.
In Nova Scotia, the Liberals are leading in 10 seats to the Conservatives' one.
Original 10:40 p.m. story
OTTAWA — The Canadian Press is projecting that the Liberal party will win the most seats in the 2019 federal election, giving them the best chance to form the next government.
Whether Liberal Leader Justin Trudeau wins a majority, however — or can reach an arrangement with another party to sustain a minority government — is yet to be determined.
The Liberals left Atlantic Canada with a commanding lead, down just a few seat from their sweep in the region in 2015, and the gains Conservatives made as more westerly votes were counted were not enough to make up the difference.
The New Democrats have been reduced to a rump in Quebec thanks to a resurgent Bloc Quebecois taking back numerous seats from the NDP.
With ballots yet to be counted in many British Columbia ridings, expected to be the Green party's likeliest territory for pickups, the Greens are still enjoying a commanding lead in the New Brunswick riding of Fredericton.
The Canadian Press