Turkish President Recep Tayyip Erdogan may present himself as the advocate of Muslims but his jibes at French leader Emmanuel Macron on Islam also aim to score points at the expense of Middle Eastern rivals, analysts say.

In the space of a few days, Erdogan has called for a boycott of French-labelled goods and questioned the "mental health" of Macron over his hardened stance against radical Islam and defence of cartoons depicting the Prophet Mohammed.

The French leader's robust defence of the right to mock religion followed the beheading of a French schoolteacher who had shown his pupils cartoons of the prophet.

Ozgur Unluhisarcikli, Ankara office director of the US German Marshall Fund think tank, says Erdogan, a pious Muslim, is "sincere" in his reaction.

"But he also benefits from this spat with Macron on both the domestic and international fronts," he told AFP.

"Being in a conflict with Western leaders boosts Erdogan's image as a national leader who defies Western hubris against Turks or other Muslims," Unluhisarcikli said.

This posture also allows him to "increase the grievances of Muslim societies towards their ruling elite in countries such as Saudi Arabia and the United Arab Emirates (UAE) which cannot match Erdogan's vigour in 'defending Islam'."

The leaders of Egypt, Saudi Arabia and the UAE -- his regional rivals -- have largely shied away from commenting on a subject which strikes a furious chord in the Arab-Muslim world.

These three countries indeed share Paris's tough line against Islamist movements which they accuse Erdogan of supporting, and which they consider a threat to their stability.

Emirati political analyst Abdulkhaleq Abdulla summed up in a tweet the contrast between the position of these three countries and that of the Turkish leader.

"The equation is very simple and clear. If Erdogan attacks Macron, that means that Macron is right," he wrote.

Didier Billion, a Turkey specialist at the French Institute for International and Strategic Affairs in Paris, believes Erdogan seeks to take advantage of "the strategic vacuum in the Middle East" caused by the declining influence of traditional heavyweights like Saudi Arabia and Egypt.

He wants to play a more robust role in the region.

Analysts say the spat between Erdogan and Macron could benefit both leaders
Analysts say the spat between Erdogan and Macron could benefit both leaders POOL / LUDOVIC MARIN

"He wants to appear as the one who does not bow his head in front of the West," he said.

According to him, "Erdogan notes, and he is not wrong, that Islamophobia is deepening in France" and in this context, his invectives against Macron are "a desire to influence the Muslims of France".

But he adds "this effort will be in vain" because Muslims in France have their own structures based on their countries of origins like Algeria or Morocco, "even if Erdogan exerts a fascination with some of the young Muslims."

Jean Marcou, a professor at Sciences Po Grenoble, pointed to the geopolitical dimension of tensions between Turkey and France.

"Since last summer, we have witnessed a series of confrontations between the two countries in strategic theatres of conflict: Libya, the eastern Mediterranean, Lebanon, Mali and Nagorno-Karabakh", he said.

"These clashes are the result of an offensive policy by Turkey which intends to impose itself as a regional power.

"If Turkey finds Paris in its path, it is undoubtedly because, in the context of Brexit, France is the only country in the EU to have nuclear power and a seat at the UN Security Council," he added.

"So France too is in a position to demand a place and a role to play on the borders of Europe (in the Middle East, in the Mediterranean or in Africa) where Turkey is located."

Billion compared the verbal confrontation between the Turkish and French leaders to a "cockfight", while also pointing to Macron's outbursts at Erdogan.

"Macron seeks to show that he does not stand idly by in the face of political Islam," he said.

"In this context, it is a boon for Macron to have a leader like Erdogan on the opposite side".

Unluhisarcikli of the German Marshall Fund agreed.

"Macron also seems to enjoy this spat. Perhaps he also has a similar strategy of boosting his image as the leader who protects 'Western values' against others," he said.

"This seems to be a win-win situation for the two leaders and lose-lose for their countries."