A fierce spat between Qatar and leading Arab nations could add another complication to the already strained relationship between the United States and Turkey. Ankara wants to calm the tension, and Turkish President Recep Tayyip Erdogan has spoken by phone with the leaders of Qatar, Russia, Kuwait, and Saudi Arabia to reduce tensions. He has also expedited legislation to deploy troops to Qatar as part of a military agreement signed in 2014. President Donald Trump, however, supports, and even takes credit for, the Saudi move to isolate its smaller neighbor.

Turkey has been cultivating closer ties with Qatar for years. The two countries pursued similar policies vis-à-vis the Arab uprisings. They see eye-to-eye on many regional conflicts from Syria to Iraq to Yemen. Ankara sees Qatar as a market for its domestic defense industry and a gateway to the rest of the Gulf.

In an effort to counterbalance Iranian influence and make inroads into the Gulf, Turkey signed an agreement with Qatar in 2014 to establish a military base in the Gulf country. At the time, the move was welcomed by both the United States and Saudi Arabia, which wanted to curb Iranian influence. But both the Saudis and Americans might have a different take on the issue now.

If the rift between Qatar and the Saudi-led Arab countries continues, Turkey may find itself in a difficult situation. The pressure could force Qatar to seek closer relations with Iran, putting Turkey in the same camp with the very country it is seeking to counterbalance. That is sure to anger Riyadh and Washington. If Ankara does not distance itself from Doha, it might also be seen as the spoiler in efforts to curb “terrorist financing” by Trump’s White House, and put the spotlight on Ankara’s cozy relations with Hamas and the Muslim Brotherhood.