Canadian Prime Minister Justin Trudeau's Liberal Party has just managed to retain power in a Canadian election, but Trudeau will now be prime minister of a minority government.

According to the BBC, Trudeau told cheering supporters in Montreal that voters had "rejected division and negativity... and they rejected cuts and austerity and voted in favor of a progressive agenda and strong action on climate change".

He continued: "Thank you for having faith in us to move our country in the right direction."

US President Donald Trump and UK PM Boris Johnson tweeted congratulations to Trudeau.

"Congratulations to @JustinTrudeau on a wonderful and hard fought victory. Canada is well served. I look forward to working with you toward the betterment of both of our countries!" Trump wrote.

Support for Trudeau began to wane after the PM publicly supported the Trans Mountain oil pipeline expansion project. His image took a more drastic hit over the past few weeks after photographs of him in brownface and blackface were published online.

"I am wary of, of being definitive about this because the recent pictures that came out I had not remembered," Trudeau said at a campaign appearance in Winnipeg at the time.

"Darkening your face, regardless of the context of the circumstances, is always unacceptable because of the racist history of blackface," the prime minister said at the time. "I should have understood that then, and I never should have done it."

"I stand here before Canadians as I will throughout this campaign and talk about the work we have to do to make a better country together," Trudeau said.