ISTANBUL — Diplomatic nuance may not be Recep Tayyip Erdoğan’s strongest suit, but Turkey’s combative leader is trying to tread carefully in his current voyage through the Arabian Peninsula.

The Turkish president set off Sunday on a whistle-stop tour through the Gulf states, in an attempt to resolve an ongoing crisis in the Gulf that has placed Ankara in a delicate position. But the trip also highlights the challenges to Turkish foreign policy amid the fast shifting dynamics of the region.

As the Arab Spring kicked off in 2011, a confident Turkey hoped to restore some of its former Ottoman-era glory, positioning itself as a leader among the Sunni Muslim nations. It threw its weight behind Egypt's Muslim Brotherhood and Syria's rebels, just as it had backed Hamas in Gaza. Qatar proved an enthusiastic ally.

This strategy backfired when the Brotherhood was overthrown in Egypt and replaced by a military strongman who, backed by the region's other status quo powers, chiefly Saudi Arabia, is restoring the pre-2011 status quo in Cairo. Syria's Turkish-backed rebels lost ground and Bashar al-Assad held on to power in Damascus. These setbacks left Turkey looking weakened and isolated in the region — just at the time that Ankara's relations with its long-standing NATO allies are fraying under Erdoğan.

On this week's trip through the Gulf, Erdoğan is looking to balance his support for allies in Qatar while staying in the good graces of the other Sunni rulers in the region — most importantly Saudi Arabia. Any trouble with the Saudis would curtail its influence in the region, and potentially hurt Turkey's fragile economy. Along with the UAE, Saudi Arabia invests billions in Turkey.

One with Doha — and other Arabs

At the beginning of June, Turkey was quick to pledge support to Qatar after Saudi Arabia, along with Egypt, the United Arab Emirates and Bahrain, imposed a blockade and cut diplomatic ties with the tiny Gulf nation. Those countries accuse the regime in Doha of supporting Islamist terrorist groups.

Qatar, the world’s richest nation by GDP per capita, produces little other than petroleum and depends on imports from its neighbors. It avoided a food shortage largely thanks to generous shipments from Turkey. Supermarket shelves in Doha are now stocked with Turkish milk, yoghurt and eggs.

Ankara also promised to expand its military presence in the country, dispatching a small contingent of troops and armored vehicles to a base Turkey maintains there.

Turkey has signaled it would like to position itself as a mediator, but it’s unlikely that the Saudi-led bloc would view Ankara as impartial.

The Turkish government has plenty of reason to worry that it may be drawn further into the crisis: Its ties to Doha are not only financial and political, but ideological — leaving Turkey vulnerable to being painted with the same brush Riyadh used on Qatar, with potentially severe economic consequences.

Speaking at Istanbul airport ahead of departing for the Saudi city of Jeddah, Erdoğan expressed hope for a swift end to the blockade. “No one has any interest in prolonging this crisis any more,” he said, adding that “enemies” were trying to stoke “tensions between brothers” in the Gulf region.

“As the elder statesman in the Gulf region, Saudi Arabia has a big role to play in solving the crisis,” Erdoğan added, staying clear of criticizing the Saudi leadership directly. The Turkish president met with both King Salman and the crown prince Sunday. He travels to Doha Monday.

The Saudi-led bloc has accused Doha of aiding terror groups, pointing toward Qatar’s staunch support of Hamas, Egypt’s Muslim Brotherhood, and various Syrian militias. (The Muslim Brotherhood, whose presidential candidate won the election in Egypt after the 2011 revolt and was later ousted in a coup, is considered a terror group by several Arab nations and Russia, but not by NATO members.)

The split stems as much from Doha’s ties to Riyadh’s archenemy, Iran — and that raises the risk that the wider region could be drawn into the crisis as it drags on. Qatar denies supporting terrorists and has condemned the blockade.

Rebel groups

The accusations leveled at Doha could easily be aimed at Turkey, which hosts a handful of exiled opposition groups, among them the Muslim Brotherhood and Hamas. Both Qatar and Turkey have provided Syrian rebel groups — some of them radical, some of them moderate — with weapons and financial aid. And Ankara does not view Iran, its eastern neighbor, as an existential threat.

In recent weeks, Turkey has signaled it would like to position itself as a mediator, but it’s unlikely that the Saudi-led bloc would view Ankara as impartial, said Atilla Yesilada, an analyst at the GlobalSource Partners consultancy in Istanbul.

“Turkey jumped in at the side of Qatar and emphasized its viewpoint by sending more soldiers to its air base there,” Yesilada said. “Any resolution would have to come from the U.S. administration, but they are seen as confused as [U.S. President Donald] Trump gives off mixed signals.”

The U.S. president, who lavished praise on Saudi Arabia during his visit in May, hasn't sought to to de-escalate the crisis. He appears to have sided with Riyadh, calling Qatar a “funder of terrorism at a very high level,” Trump’s secretary of state, Rex Tillerson, has urged calm. Some 10,000 U.S. service members are stationed at an air base in Qatar.

If Qatar comes out of the crisis unscathed, Doha will likely reward Turkey for its loyalty. But other Gulf states might withdraw their investment in turn.

For now, neither side appears prepared to back down, although the Saudi-led bloc watered down a list of demands that originally called on Qatar to downgrade relations with Iran, close down the Turkish air base and shutter its TV network Al-Jazeera — an outspoken cheerleader of the Arab Spring revolutions and a thorn in the side of the region’s conservative governments.

Turkey has rejected demands that it withdraw from Qatar, but Ankara has been at pains to assure Gulf nations that its troops are no threat to the region. “The base in Qatar is both a Turkish base and one that will preserve the security of Qatar and the region,” Defense Minister Fikri Işik said last month.

For Ankara, escalation carries real risks, given its troop presence and the economic losses to Turkey. Qatari investment in Turkey, albeit substantial, is dwarfed by much larger inflows from Saudi Arabia and other Gulf nations.

Arab visitors are propping up Turkey’s struggling tourism sector, which was just dealt another blow by Germany’s announcement warning its citizens about travel to the country. Qatar, with its tiny population of 2.5 million, makes up only a small portion of Gulf tourists.

Turkey’s economy will suffer unless a peaceful solution is found, Yesilada said. If Qatar comes out of the crisis unscathed, Doha will likely reward Turkey for its loyalty. But other Gulf states might withdraw their investment in turn.

“I don’t see the Saudis being humiliated by Qatar and then sending their precious funds to Turkey, which would have been instrumental in its defeat,” Yesilada said. “On the other hand, if Qatar loses, the Saudis may also punish Turkey for helping Qatar. Economically, it’s a lose-lose scenario.”