Former U.S. President Barack Obama has given his backing to centrist candidate Emmanuel Macron ahead of French elections this Sunday, telling the presidential hopeful to work hard until the very last minute of the campaign.

In a phone call on Thursday, posted on the Twitter feed of Macron, Obama told the presidential frontrunner: "The main message I have is to wish you all the best in the coming days and make sure that, as you said, you work hard all the way through because you never know, it might be that last day of campaigning that makes all the difference."

Tweet 1

Macron is running as an independent in what's being described as one of the most uncertain elections in French history. Polls position him in first place but closely followed by his far-right opponent Marine Le Pen.

Aside from the vote being highly spread between all the candidates, it's also expected that about 38 percent of French voters will abstain, which increases the unpredictability of the vote.

Macron thanked Obama for taking the time to speak to him and promised to defend progressive values. Towards the end of the conversation, Obama wished Macron "good luck."

Follow CNBC International on Twitter and Facebook.