In March 2015, two presidents landed in Saudi Arabia two days apart. The first was Turkey’s Recep Tayyip Erdogan, who landed in Jeddah and was greeted by the provincial governor and some of his aides. The second was Egypt’s Abdel-Fattah al-Sissi, who landed in Riyadh and was received with royal honors by the new king, Salman.

Both had come to congratulate Salman on his ascension to the throne. But the Saudi message was clear. Sissi, Erdogan’s rival, was the guest of honor; Erdogan was merely a candidate for membership in the Saudi club.

LISTEN: Are Netanyahu and Trump on collision course? 0:00 -- : -- 15 Skip 15 seconds backwards Play audio 15 Skip 15 seconds ahead 1 X Change playback rate from 1 to 1 Mute audio

To really understand Israel and the Middle East - subscribe to Haaretz

But for Erdogan, this visit proved to be a historic turning point. After a long period of tense relations with Riyadh, especially under the former king, Abdullah, and a schism with Egypt, Erdogan was receiving the Saudi seal of approval. He was entering the Arab world’s grace with head held high.

Three years later, Erdogan’s roller-coaster ride has reached the top. Now Saudi Crown Prince Mohammed bin Salman is the one seeking a meeting with Erdogan, and the Turkish president isn’t rushing to grant it.

The Kurds might pay the price

In Buenos Aires, where the G-20 summit is taking place Friday, people will be rubbernecking to see whether the two leaders actually meet and grant Mohammed international absolution. Or perhaps he’ll have to make do with meeting with U.S. President Donald Trump.

Trump would be happy to put the murder of journalist Jamal Khashoggi behind him and continue relations with Saudi Arabia as if nothing had happened. He has rejected the CIA’s conclusion that Prince Mohammed not only knew about but ordered the murder. He has given the Saudi judicial system his blessing and recruited Israel as the prince’s defense attorney. And now he wants to move ahead with Riyadh’s planned purchase of $110 billion worth of arms.

But Erdogan is in no hurry. Turkey’s police and intelligence services are still looking for parts of Khashoggi’s body and the collaborator who got rid of them, and not all the tapes have been leaked to the public. Erdogan apparently has more explosive ammunition against Mohammed, or at least he won’t confirm that all the material has been published.

That’s because the real arm-wrestling match Erdogan is engaged in isn’t against Prince Mohammed or Saudi Arabia but against the U.S. administration. Turkey has concluded that Trump will do anything to rescue Mohammed from this mess and protect Saudi Arabia from the earthquake that would rock the kingdom if the prince were proved directly responsible for the murder. In that case, demands that Mohammed stand trial in an international court would be the least of Trump’s worries.

Erdogan is willing to help Trump, but not for free. His main concern is America’s close collaboration with the Kurds’ People’s Protection Units in northern Syria, which Erdogan views not just as terrorists but as a concrete threat to Turkey.

In a barb clearly aimed at Washington, Erdogan said this week, “This is an opportunity for those claiming to be allies, strategic partners who want to strengthen relations ... and carry them into the future. We will acknowledge that they side with Turkey when they no longer stand as shields in front of terrorist groups.”

America’s decision to set up observation posts manned by U.S. troops along the western part of the Syrian-Turkish border is unacceptable to Turkey. According to U.S. Secretary of Defense James Mattis, these outposts would let the soldiers “call the Turks and warn them” of any approaching danger. But Turkey hasn’t hid its suspicion that the outposts are actually there to protect Kurdish fighters from a Turkish attack.

“The day when we crush these terrorists is approaching,” Erdogan threatened this week, shortly before convening his National Security Council for a meeting that lasted more than four hours. Washington, for its part, warned that if Turkish forces move into eastern Syria, this could spark clashes with American forces. But Erdogan shows no signs of folding.

Turkey considers the Syrian Kurds its top security concern. But the issue also serves Erdogan’s interests in the local elections slated for March. Aggressive talk about the United States, standing firm against the Kurds and protecting the border are all good issues for Erdogan’s party to run on in these elections, which will be a kind of referendum on Erdogan.

Not for the first time, Erdogan’s uncompromising stance is creating a serious dilemma for Trump. Should he prefer Turkey to the Kurds, or should he continue Washington’s vital support for forces that have proved highly effective in the war against the Islamic State, and whose need for American protection could now serve as a pretext for U.S. troops to remain in Syria?

But this time around, another factor has played into Erdogan’s hands. With Prince Mohammed’s standing in the balance, and with him, the battle against Iran, Trump may well decide that the Kurds will have to pay the price of America’s relations with Saudi Arabia.

Recep's Russian revival

Nor is this Trump’s only problem with Erdogan. He doesn’t know what to do about the deal Turkey signed to buy S-400 missiles from Russia. Despite pressure from the United States and other NATO countries, Erdogan hasn’t given in.

Moreover, Russian President Vladimir Putin announced this week that Russia and Turkey have decided not to use the dollar as the medium of exchange for the deal. Putin said he’s against using a currency that’s a tool for applying pressure – a reference in part to U.S. sanctions on Iran under which Iran is barred from making transactions in dollars using American banks.

This announcement came just days after Putin and Erdogan inaugurated the underwater portion of a new gas pipeline between Russia and Turkey. This will enable Russia to sell gas to Europe without going through Ukraine.

It’s worth recalling that just two and a half years ago, the Russian-Turkish relationship was like a cold war following Turkey’s downing of a Russian plane. Turkey suffered a harsh economic blow that shut down tourism from Russia, froze Turkish agricultural exports to Russia and forced Turkish factories in Russia to close.

Erdogan got the message, apologized and reached unprecedented agreements with Russia about both the Syrian civil war and the nature of the Ankara-Moscow relationship. And now Erdogan can use his relationship with Russia as a way of pressuring Washington.

The Khashoggi murder also gave Erdogan an unexpected bonus in terms of relations with the European Union. Before this shocking incident, Erdogan was considered a preeminent human rights violator due to his suppression of the media and his wholesale jailing of political opponents. But in light of Khashoggi’s brutal killing, Erdogan can portray himself as a liberal whose bible is the Universal Declaration of Human Rights.

Thus, even though the European Court of Human Rights has demanded that Erdogan free the head of Turkey’s Kurdish party, Selahattin Demirtas, who has been in jail for two years, and even though Erdogan crudely rejected this ruling – which is binding because Turkey is a member of the court – the EU has decided to resume talks about Turkey joining the union, after a two-year hiatus.

But these talks are unlikely to produce any practical results because most EU member states, above all Germany, have said Turkey can’t join as long as it violates human rights and freedom of expression, and Turkey isn’t likely to stop doing that. Just last week it arrested another 550 people “suspected” of belonging to the organization of the cleric Fethullah Gulen, who is living in exile in Pennsylvania.

Turkey also won European praise for fulfilling 66 of the 72 conditions the EU set for letting Turks travel to Europe without visas. Turkey’s demand for visa-free travel was a key condition of the deal it signed with the EU to stop the flow of refugees through Turkey into Europe, for which it also received $6 billion.

Turkey had actually fulfilled most of these conditions shortly after signing the agreement. But the six that remain – which include changing its draconian counterterrorism laws and signing agreements on police and judicial cooperation with each EU member state – still pose a major obstacle.

First, Turkey sees its counterterrorism laws as a vital tool in its war against the Kurds, and also as a legal framework that Erdogan can use to fight his political rivals on the pretext of fighting terror. Second, signing the cooperation agreements would require Turkey to recognize Greek Cyprus. But in the meantime, Erdogan can present the European praise as an achievement.

Erdogan can enjoy the heady experience of having his roller coaster poised at the top. But roller coasters, as even Erdogan has learned, swiftly hurtle downward.

And indeed, a serious economic crisis lies around the corner. Inflation is high at 25 percent, unemployment refuses to fall, and foreign investors are hesitating to return to Turkey. Unfortunately, neither investors nor the economic data are impressed by the international glory in which Erdogan is basking.