In a video posted to Twitter, former president Barack Obama says he is "supporting" French presidential candidate Emmanuel Macron. Elections are expected to take place May 7. (Emmanuel Macron)

PARIS — Former president Barack Obama formally endorsed Emmanuel Macron in the French presidential election on Thursday, in a video statement released by the Macron campaign.

“The French election is very important to the future of France and the values that we care so much about,” Obama said in the video. “Because the success of France matters to the entire world.”

“I have admired the campaign that Emmanuel Macron has run,” Obama said. “He has stood up for liberal values. He put forward a vision for the important role that France plays in Europe and around the world, and he is committed to a better future for the French people. He appeals to people’s hopes and not their fears. …

“Because of how important this election is, I also want you to know that I am supporting Emmanuel Macron to lead you forward. En Marche! Vive la France.” En Marche! (Onward) refers to the political party founded by Macron last year, an independent coalition that seeks to blend the fiscal responsibility of the right with the social liberalism of the left.

It is unusual for former U.S. presidents to weigh in publicly on the domestic politics of foreign countries, even historic allies like France. But Obama has taken a particular interest in speaking out against the rising tide of populism that culminated with the election of Donald Trump in the United States at the end of Obama's two-term tenure in November.

Even before he left office, Obama urged British voters not to support the “Leave” campaign in the Brexit referendum.

Speaking alongside former British prime minister David Cameron in April 2016, the former president warned of the financial consequences that leaving the European Union might bring.

“I think it’s fair to say that maybe [at] some point down the line there might be a U.S.-U.K. trade agreement, but it’s not going to happen any time soon because our focus is in negotiating with a big bloc, the European Union, to get a trade agreement done. The U.K. is going to be in the back of queue,” Obama said.

In the June vote, Britain ultimately ignored Obama’s advice, opting to leave the E.U. by 52 to 48 percent.

The French election, in which the future of the E.U. itself could be at stake, has widely been seen as the next potential populist showdown. The contest pits the pro-E.U., centrist Macron against Marine Le Pen, a far-right populist whom President Trump has supported but stopped short of endorsing. Le Pen has run on a staunchly anti-immigrant, anti-Europe platform of economic protectionism.

Le Pen has said, if elected, she would hold a referendum on France's membership in the E.U., a bloc she sees as a threat to her country's sovereignty.

Obama enjoys a striking popularity in France, America’s “sister republic.” Earlier this year, a group of voters dissatisfied with the names on the French ballot — mostly with Le Pen — began posting campaign posters with Obama’s face and the slogan “Oui on peut!” (“Yes we can!”) throughout Paris. Although their “campaign” began as a joke, it ultimately morphed into an online petition to persuade Obama to run for the French presidency.

In the end, the petition received nearly 50,000 signatures.

The affinity between Obama and the Anglophone Macron is well known; late last month, before the first round of the French presidential vote, Obama called Macron to offer his advice, which the Macron campaign then released in video format.

The latest polls show Macron leading Le Pen by about 20 points ahead of the final vote Sunday.

As of early Thursday afternoon, Le Pen had not responded publicly to news of the Obama endorsement.