Justin Trudeau will hold on to power only as head of a minority government, according to projections by Canadian media.
National broadcaster CBC says his Liberal party is expected to claim the most seats in parliament, securing him a second term.
Before the vote, opinion polls showed Trudeau neck-and-neck with the Conservative leader Andrew Scheer, but the Liberals had won 155 out of 304 electoral districts that had reported results by 1am local time.
However, Trudeau is expected to fall short of the 170 seats needed to secure a second majority government. His grip on power will be weakened and he is expected to be forced to work with smaller left-wing parties to pass legislation.
The result follows a rocky campaign for Trudeau. “Four years after the photogenic Liberal leader swept to power promising ‘sunny ways’ after nearly a decade of Conservative rule,” says The Guardian, he “struggled to inspire voters as he campaigned for re-election”.
Last month, Time magazine published a photograph of Trudeau wearing brownface when he was a teacher in 2001. Trudeau apologised and agreed it was a racist photo.
Responding to the results, Donald Trump tweeted: “Canada is well served. I look forward to working with you toward the betterment of both of our countries!”
One Canadian analyst was less gracious. “We’re seeing a much-needed chastening of the Liberal party,” said David Moscrop, a political scientist at the university of British Columbia. “Some of [the result] is a backlash against Liberal arrogance and entitlements. The Liberals set the bar so high they’re bound to run into it.”
Whether Trudeau forms a fully-fledged coalition remains to be seen. He might instead agree a confidence-and-supply deal in which junior partners will agree to support him on individual pieces of legislation.