By George Friedman

Turkey sent troops into Syria yesterday. This caused Russia to declare its unhappiness with Turkey. U.S. Vice President Joe Biden visited Turkey yesterday. The atmosphere may not have been loving, but it was cordial, with none of the venom that had been visible since the coup attempt. The Russians have agreed that to halt operations from Iran’s Hamedan air base, but might return at some point. There is some sort of political battle raging in Iran over giving the Russians permission to use Hamedan in the first place. All of these apparently distinct threads tie together into a single, geopolitical story.

Let’s begin with Iran. Iran has kept its independence for centuries, fending off two threats. One was Turkey, in its Ottoman guise. The other was Russia, both the empire and the Soviet phase. As an example, during World War II, Iran remained formally independent, but was occupied in the north by the Soviets and in the south by the British. After the war, the Soviets showed themselves reluctant to leave. It was American pressure on both the Soviets and the British that restored Iranian independence. It wasn’t American goodness. The Americans opposed Soviet expansion and were undermining the British Empire. Iranian and American interests coincided.

The United States increased its power and influence in Iran, until the Islamic Revolution tore the relationship apart. The United States became Iran’s main adversary, but not its only one. Iran remained extremely cautious about Soviet designs, particularly in the early phase of the Islamic Republic. It remembered its long history with Russia. As for Turkey, it was weak in this period and didn’t present a threat. Iran was hostile to the United States and cautious about Russia.

The recent deal on nuclear weapons was forced through in Iran by factions who argued that a policy of complete hostility toward the United States was undermining the Iranian economy and political interests. Another faction (or several) opposed the deal as a betrayal of Iranian interests and as a capitulation to the United States. This faction, rooted in the Islamic Revolutionary Guard Corps, fought and lost the fight. But it did not give up.

For those in this faction, hostility toward the United States was the foundation of Iran’s foreign policy. Given the decline in U.S.-Russian relations, they saw Russia as an alternative to the United States. The government, which negotiated the deal, saw Russia as more dangerous to Iran in the long term, simply because the United States was far away and Russia was very near. To force the situation, someone in the Iranian government gave the Russians permission to use Hamedan air base for strikes against Syria. They apparently did not tell a wide range of people in the government that this was going on. There were apparently a number of flights out of Hamedan before the news broke. When the news broke, the flights were stopped cold. Since then, a political battle has raged in Tehran that has multiple dimensions, including a clash over who is actually in charge.

But at the heart of this infighting is a question over how to align Iran’s foreign policy. Turkey is rising. Russia is engaged in the region. Both of them are potential threats. Some see the alignment of Turkey and Russia as an opportunity for Iran to join the relationship. These are the people who see the United States as the primary threat to all three countries and see such an alliance as a counterweight to the Americans. They see little risk from Turkey or Russia. There is no pro-American faction, but there is a faction that sees the Turks as Iran’s historical nightmare. Very high stakes poker is being played in Tehran.

In the meantime, Turkey has again flipped its position, leaving Iranian supporters of a trilateral alliance swinging in the breeze. Since the coup, Russian President Vladimir Putin and Turkish President Recep Tayyip Erdoğan appeared to have forged an unbreakable relationship. Two things indicated that it was not as unbreakable as the Russians might have hoped. One was the fact that the Russians were supporting Syrian President Bashar al-Assad, and the Turks were his enemy. After much tap dancing, it became clear that Turkey was not going to shift to Russia’s position on Assad, and therefore a fundamental rift existed between Turkey and Russia. The second indicator was that Turkey continued to allow the United States to use İncirlik air base, with only a few hours’ interruption during the coup. The Russians, after some discussion, were denied access to the base. That indicated that whatever the rhetoric or gestures, Turkey was not planning a deep break with the United States.

Today, Turkish troops moved into Syria. About 20 tanks moved a few kilometers into Syria, accompanied by some special forces. There were airstrikes and some artillery shelling. In the general scheme of things, it was a minor move, but was a move carried out in coordination with the United States and not with Russia. There followed a news conference with Biden and Turkish Prime Minister Binali Yıldırım, and the special relationship between Russia and Turkey seems to have lasted about a month.

The Turks’ problem is the same as the Iranians’ problem. The Russians are Turkey’s historical competitors in the Black Sea and have always coveted the Bosporus, the strait connecting the Black Sea and Mediterranean. For the Russians, taking the Bosporus was the holy grail of its foreign policy. Add competition in the Caucasus, and an increasingly active Russia could prove a significant challenge in these regions. This may sound farfetched, but Russia fighting a war in Syria was once farfetched as well.

Turkey is emerging as a major power, but it has not yet emerged. Embracing Russia certainly would require a shift on Syria. The Russians have offered concessions in Armenia, but in the end, Russia would remain the dominant power, able to reverse what it offered. Plus, as with Iran, Russia is close and not going anywhere. Turkey must have a counterweight to Russia, certainly while it is developing its own power, and the only counterweight available is the United States.

What all this has in common is that without the United States in the mix, Turkey and Iran would have to cope with Russia by themselves, and neither is confident that they can manage that. Both, in different ways, need the United States to stabilize their positions. There is much more consensus on this in Turkey than in Iran, where this issue is generating a significant internal struggle over all aspects of foreign policy. Some see the U.S. as the only threat. Some see the U.S. as a threat that can be balanced.

Still, the discussion is about what role the United States plays in their foreign policy. Turkey is searching for a balance that includes but limits the United States. Iran is searching for a balance where the U.S. is still seen as an untrusted adversary, but can be used anyway to counter the Russians.

For the moment, Russia seems to have lost its leverage in both Turkey and Iran. Given the speed with which Turkey changes its direction these days, nothing is constant. Similarly, for the moment, it has lost is landing rights in Iran and is on the defensive. All this can change. But the geopolitical logic remains intact: a supporter who is far away is less threatening than one nearby. That means that Turkey and Iran will be very cautious with Russia. It also means that both will seek a way to use the United States for its own interests. And the United States will do the same.