Trudeau was the first Canadian prime minister the United States honoured with a state dinner in nearly two decades, when Obama invited him and his wife to Washington in March 2016 after the prime minister won power the previous October.
"The world needs his progressive leadership now, and I hope our neighbors to the north support him for another term".
The most famous African-American politician did not mention Trudeau's blackface scandal that threatened to crater his chances at re-election.
Obama's tweet included endorsements of Trudeau taking on climate change and described him as a "hard-working, effective leader".
Obama also endorsed French President Emmanuel Macron in a 2017 election and he warned British voters against backing leaving the European Union in a referendum in 2016.
Thus far, Mr. Obama has declined to endorse any of the Democrats looking to defeat President Trump in 2020, including his former vice president, Joe Biden.
We now have some clarity of thought from Justin Trudeau - he knows the country is in danger - and he is now saying that he has tried over four years to bring it together.
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 Liberal Occasion too tweeted a image of two leaders with Obama's tweet inserted between them and captioned it as- #ChooseForward. A year earlier, while on his final overseas trip as president, he offered an endorsement of German Chancellor Angela Merkel, according to a report by the Washington Post.
University of Toronto history professor Robert Bothwell told the Associated Press Wednesday that there was no precedent for an endorsement of candidate in a Canadian election by a former US president. He added that "it was something I didn't think was racist at the time, but now I recognize it was something racist to do". The former president has always been popular with many Canadians.
"The clearest and best result for this election is if we avoid a false majority, for either the Liberals or the Conservatives, to force them to have to listen and to work with some of the parties in the House of Commons that may be smaller".
"Canada has been very well served with (Justin Trudeau) as their prime minister", Heyman wrote.
"As @BarackObama Ambassador to Canada I got to work directly with @JustinTrudeau and saw his dedication and effectiveness as a leader", wrote Heyman.