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.
Although polls have suggested a deadlock between the two front-runners, the Liberals appeared to have an edge over the Conservatives in Ontario and Quebec, which account for almost 60 per cent of the 338 seats up for grabs.
Still, an unexpected surge in support for the Bloc Quebecois upended the hopes of both the front-running parties for gains in Quebec.
And a bounce for the NDP after Jagmeet Singh's performance in the leaders' debates ate into Liberal support in Ontario and British Columbia.
The Green party, which had hoped for a big breakthrough in this election, appeared to stall mid-campaign but is in a battle with the NDP in B.C. — and if its lead in Fredericton holds up, its members will be delighted.
Maxime Bernier, leader of the fledgling People's Party of Canada, is fighting to retain 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.