Turkey’s ruling Justice and Development Party (AKP) feels a close affinity to the Brotherhood and continues to support Erdogan in his championing of ousted Egyptian President Mohammed Morsi. Ankara has also signaled that Brotherhood and Hamas leaders who are no longer welcome in Gulf states would be welcome in Turkey.

Although he presents himself as a staunch supporter of the Muslim Brotherhood, and its offshoots like Hamas, Erdogan also refrains from dwelling on the fact that the Saudi regime, together with its regional allies, is determined to crush the Brotherhood and Islamist groups associated with it.

Erdogan who incessantly blasts the West for supporting Egyptian President Abdel Fattah al-Sisi, is noticeably mute when it comes to criticizing Saudi Arabia, although it backed the Egyptian coup. Erdogan also had to swallow some pride when attending King Abdullah’s funeral last week knowing that Sisi would be there, too.

This importance has not, however, prevented political controversy in Turkey, where many questioned why a day of mourning was declared for the late king when this had not been done for the large number of Turks killed in recent disasters, terrorism attacks, as well as those killed in anti-government protests.

The death of King Abdullah bin Abdulaziz of Saudi Arabia has highlighted the importance Turkey attaches to this key Gulf state despite deep political differences between the two countries over issues such as Egypt and Ankara’s support for the Muslim Brotherhood.

Despite this support for the Brotherhood, Turkish foreign policy experts say Turkey will maintain its realistic approach to Saudi Arabia under King Salman, regardless of existing differences.

Nebahat Tanriverdi from the Ankara-based Center for Middle Eastern Strategic Studies (ORSAM), for example, does not expect a change in Saudi Arabia’s policies, which are predicated on seeing movements like the Islamic Brotherhood as a threat.

“Saudi Arabia’s support for Egypt is not based on personalities but on this threat perception,” Tanriverdi told Al-Monitor.

“Egypt is currently negotiating for sophisticated weapons from Russia and France that will be bankrolled by Saudi Arabia and the United Arab Emirates,” she added, pointing out that Egypt remains a front-line country for Riyadh in terms of its security.

Erdogan and the AKP, however, see the Brotherhood as salvation for the future Middle East and are aware that democratic elections in the region are more than likely to produce governments led by this group. This is what lies behind their anger in seeing the group crushed in Egypt.

But there is also regional realpolitik for Ankara to consider despite Erdogan’s angry rhetoric aimed at Western countries for supporting Sisi and his government. This is preventing Erdogan from lashing out at countries such as Saudi Arabia, even though the support for Sisi by these countries is far more concrete than what he gets from the West.

Erdogan’s critics declare this to be a glaring contradiction. Burhanettin Duran, the general coordinator of the Ankara-based Foundation for Political, Economic, and Social Research (SETA), however, believes there are concrete reasons underlining Erdogan’s position.

“Turkey and Saudi Arabia ended up supporting different positions with regard to the regional order they wanted to see after the Arab Spring. This is apparent in Egypt. Saudi Arabia is also unhappy about Turkey’s support for the Muslim Brotherhood. Yet there are no tensions between the two countries,” Duran told Al-Monitor.

“The reason is that there is stability in Saudi Arabia. Turkey also respects Saudi Arabia as a regional power, and recognizes its importance as an oil supplier. Saudi Arabia also has importance for religious reasons,” Duran added.

Pointing out that Turkey also finds an interlocutor in Saudi Arabia despite differences, Duran indicated Ankara does not have a policy based on advocating democracy or regime change.

“Turkey only takes a strong position when regimes start violently confronting their own people. This is not the case in Saudi Arabia,” Duran said. He added that the situation could change if situations like those in Egypt or Syria emerged there.

Mutual recognition of each other’s regional importance ensures in the end that relations between Turkey and Saudi Arabia are cordial even if they lack the warmth they might have had if differences did not exist over Egypt, the Muslim Brotherhood, and even to an extend over Syria, where Erdogan and the AKP would ultimately like to see a Muslim Brotherhood government emerge.

In the final analysis Turkey’s position on Saudi Arabia is no different from the position of the West, based on realpolitik as it is. Western countries maintain good ties with Riyadh, and try and keep the Saudi royal family in power for strategic reasons to do with stability, and considerations relating to energy, despite the lack of democracy in that country, and its human rights violations.

A Western diplomat in Ankara, who wished to remain anonymous due to his sensitive position, referred to “Erdogan’s dilemma” with regard to Saudi Arabia. “Erdogan clearly resents all those who are trying to criminalize the Muslim Brotherhood, and who are supporting Sisi, and makes this apparent in his speeches,” the diplomat told Al-Monitor.

“But he understands that the Saudi regime is a necessary bulwark against the potential for chaos in a country were the ground is fertile for extreme Salafist ideologies to spread like wildfire among a disgruntled youth, destabilizing the Middle East even more,” he added.

This “dilemma” that suggests a double standard on the part of Erdogan, however, is not something that opposition parties are prepared to overlook given the intense rivalry and acrimony that currently marks domestic Turkish politics.

Declaring Erdogan to be “more royalist than the king,” Umut Oran, a prominent deputy from the main opposition Republican People's Party (CHP), blasted the decision to declare a day of mourning for Abdullah, and pointed out that this was not declared in Saudi Arabia.

Ultraconservative Wahhabism, the founding philosophy on Saudi Arabia, forbids declarations of mourning. Oran also recalled that the Saudi king had refused to visit the mausoleum of Mustafa Kemal Ataturk, the founder of the secular Turkish Republic, to pay his respects when he visited Turkey in 2006.

“It is not possible for either me or my party to accept that [Prime Minister Ahmet] Davutoglu and Erdogan have declared a day of mourning for someone who dealt with a person so dear to us in this way,” Oran told a party gathering in the eastern province of Tunceli.

Oran listed incidents in which a large number of Turks had died in recent years, including the killing of 34 citizens of Kurdish origin by Turkish jets in December 2011 near the border town of Uludere after they were mistaken for terrorists, and the Syria-related car bomb attack in the town of Reyhanli in May 2013 that killed 50 people. He asked why a public mourning had not been declared, with flags flying at half-staff in those cases.

Oran’s objections, which were repeated by many, have to do with domestic politics. When it comes to foreign policy, however, it appears Ankara’s approach to Saudi Arabia will remain realistic, rather than be based on the “ethical line” Erdogan and the government claim to be pursuing when it comes to other countries.