Former President Obama endorsed Canadian Prime Minister Justin Trudeau on Twitter Wednesday afternoon, just days before Canadians go to the polls on Monday. Photos of Trudeau from years ago dressed in blackface and brownface were released last month, casting a shadow over his campaign in the tight race.

"I was proud to work with Justin Trudeau as President," wrote Mr. Obama in a tweet. "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."

The Liberal Party's leader, who was sworn into office in 2015, responded to the former president's endorsement on Twitter, writing, "Thanks my friend, we're working hard to keep our progress going."

I was proud to work with Justin Trudeau as President. 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. — Barack Obama (@BarackObama) October 16, 2019

Mr. Obama and Trudeau had a well-documented, friendly relationship. In March of 2016, the former president hosted Trudeau for the first official state visit by a Canadian leader in almost 20 years. Both politicians took strong stances on climate change and LGBTQ rights during their terms, with some even comparing Trudeau to Mr. Obama.

Get Breaking News Delivered to Your Inbox

It seems the "bromance" between the two leaders continued on after Mr. Obama's departure from the White House. Trudeau tweeted a photo of the men laughing together in June, writing, "Always great to catch up."

However, Trudeau's image as a young, liberal leader took a hit last month when the controversial photos surfaced. At least three photos were released that show Trudeau wearing darkened makeup on his face.

The first picture, published by Time magazine, appears in a 2001 yearbook from a private school where Trudeau used to teach. He said the costume was from a party with an "Arabian Nights" theme.

The politician apologized for the images publicly multiple times. "I should have known better," Trudeau told reporters. "I'm pissed off at myself. I'm disappointed in myself."

Mr. Obama, who is popular with many Canadians, hasn't yet offered his support for any of the Democratic candidates in America's 2020 presidential election. The October 21 Canadian election is expected to be close.

The former president's tweet has garnered criticism from some who claim the endorsement is "foreign interference" in the country's election. But, Elections Canada, which oversees the country's elections, said that people from other countries were permitted to give their opinion, reports the BBC.

"Whether expenses were incurred, who incurred them and for what reason would be among the factors that need to be considered before determining if undue foreign influence has taken place," said Elections Canada spokeswoman Natasha Gauthier, according to the BBC.

Drew Fagan, a professor of public policy at the Munk School of Global Affairs, called the support "unusual." He said Mr. Obama's support "now could become an issue" and make an impact in the tight race.