Former President Barack Obama endorsed Canadian Prime Minister Justin Trudeau in his reelection effort Wednesday, part of an attempt to boost the embattled leader's chances of staying in office.

Obama and Trudeau maintained a friendly relationship while they were both heads of the neighboring countries -- Obama honored Trudeau with the first state dinner for a Canadian since 1997 soon after the young leader was elected. The progressive politicians also met for a beer at a Canadian brewery earlier this year.

"I was proud to work with Justin Trudeau as President," Obama said. "He's a hard-working, effective leader who takes on big issues like climate change. The world needs his progressive leadership now, and I hope our neighbors to the north support him for another term."

JESSE WATTERS BLASTS CANADIAN PM TRUDEAU, PRIVILEGE NOT AN EXCUSE FOR BLACKFACE IN 2001

Trudeau's Liberal Party is in a very close race with Canada's conservative party, according to a Canadian Broadcasting Corporation's average of polls. This is as Trudeau is still recovering from recently exposed photos of him wearing blackface in 2001, a scandal that forced him to make a public apology.

"I am wary of being definitive about this because the recent pictures that came out, I had not remembered," he said in September. "And, the question is, how can you not remember that? The fact is, I didn't understand how hurtful this is to people who live with discrimination every single day."

An endorsement from Obama, who was highly popular in Canada during his time in office, might boost the Liberal Party in its effort to nab a victory during Monday's election.

CLICK HERE TO GET THE FOX NEWS APP

In American elections, Obama has chosen to avoid endorsing a contender in the Democratic presidential primary thus far, although his vice president, Joe Biden, is considered one of the frontrunners.