The U.S. and Qatar have been key allies for decades, with close military and economic ties. Qatar is home to the United States’ biggest base in the region, and in turn the U.S. has pledged to protect the small, oil rich country that juts out into the Persian Gulf. But the relationship is being tested like never before by the latest example of Qatar snubbing the interests of Uncle Sam – or, put more generously, its maverick foreign policy. The U.S. recently placed severe sanctions on Turkey’s economy for refusing to release an American pastor detained for almost two years, sparking a currency crisis. Qatar was the first, and so far only, nation to offer Turkey tangible aid in the form of a US$15 billion investment and other types of financial assistance. Although the Gulf country has long pursued policies out of step with the U.S., such as maintaining good relations with Iran and aiding various groups that the U.S. considers terrorists, its very visible support for Turkey in the dispute poses a direct challenge to the Americans. And while the U.S. has in the past practiced patience with its sometimes wayward ally, President Donald Trump is often willing to toss out the rulebook and has previously lambasted Qatar on Twitter. As a longtime observer of the region’s complicated economic and political developments, I believe that Qatar’s interjection in the U.S.-Turkey crisis raises two important questions: Why is Qatar willing to risk its close relationship with the U.S.? And why has the U.S. let it get away with this behavior for so long? U.S. Defense Secretary Jim Mattis greets military dignitaries at Al Udeid Air Base in Qatar. Reuters/Jonathan Ernst Punching above its weight A country of just 320,000 citizens – as well as 2.32 million expatriate residents – Qatar has a habit of using its massive oil and natural gas reserves to exert influence in the Middle East and beyond. Such a hyperactive foreign policy is very unusual for a small state like Qatar. Qatar made its offer to Turkey during a recent visit by Qatari leader Sheikh Tamim Al Thani to Ankara. The announcement helped stem the rout in the lira, which lost a third of its value in a month. It was followed by a so-called currency swap agreement that will allow Turkey to bypass the U.S. dollar in bilateral trade and financial transactions with Qatar. While Iran and several Arab countries including Kuwait have expressed opposition to the U.S. sanctions, none so far has offered tangible financial support similar to Qatar’s. Meanwhile, the U.S. is trying to put economic pressure on Turkey in hopes it spurs the release of the American pastor, who has been detained for nearly two years on allegations he supported the failed July 2016 coup. Qatar’s aid clearly counteracts that pressure. So far, the U.S. hasn’t publicly reacted to Qatar’s actions. U.S. sanctions prompted a currency crisis in Turkey. AP Photo/Lefteris Pitarakis Allies aiding adversaries This gesture of support for Turkey is not the first time that Qatar has taken a stand that conflicts with U.S. foreign policy objectives. On several occasions in the past two decades, the U.S. has expressed concern about Qatar’s support for various Islamist and extremist groups, such as the Muslim Brotherhood, as well as its relations with Iran. In May U.S. officials issued a warning after a newspaper reported evidence of clandestine contacts between Qatar and Iran’s revolutionary guards and other groups it supports. This behavior may seem puzzling because ever since its creation as an independent state in 1971, Qatar has relied on the United States for its external security. At the same time, Qatar hosts about 10,000 U.S. military personnel at Al Udeid Air Base, home of the U.S. Air Force Central Command, which is used to conduct operations in Syria, Iraq and elsewhere. The United States also maintains strong economic relations with Qatar as its largest foreign investor – particularly in oil and natural gas production. All smiles as Qatar’s Emir Sheikh Tamim Bin Hamad Al Thani and Turkish President Recep Tayyip Erdogan. Presidential Press Service/Pool via AP Qatar’s possible rationale So why would Qatar risk jeopardizing the relationship by aiding Turkey so publicly? One possible explanation is that Turkey itself has become an important strategic and economic partner. The two signed a military cooperation agreement in 2014, which allowed Turkey to maintain a small base in Qatar. When fellow Gulf Cooperation Council states Saudi Arabia and the United Arab Emirates broke diplomatic relations with Qatar in 2017 and imposed a trade embargo, Turkey increased the number of its troops at the base to deter military action. This was important to Qatar because the U.S. seemed to be showing more support for Saudi Arabia and the UAE in the standoff, a perception reinforced by highly critical tweets from Trump. Qatar’s recent expansion of trade with Turkey also helped it survive the embargo as Turkish consumer goods flowed in, leading to a surge in trade between the two countries. Bilateral investment between Qatar and Turkey has also increased in recent years. Qatar has nearly $20 billion in investments in Turkey, and a large number of Turkish construction firms are active in Qatar. Another possible explanation is that Qatar’s leaders simply believe that the U.S. needs Qatar more than Qatar needs the Americans. The rationale is that the American military bases there are vital to its ability to project power in the region. Meanwhile, Qatar’s significant reserves of oil and gas make it a valuable economic partner. As a result, Qatar may believe the U.S. will continue to show a high level of patience, even in the face of support for Turkey. Things are a bit frostier in the Oval Office with Trump. Reuters/Kevin Lamarque US patience running thin? It is true that the United States has tended to be patient with Qatar’s maverick foreign policy, including over Iran. But Qatar’s government would be wise to have a realistic understanding of the erratic and unpredictable nature of American foreign policy under the Trump administration. Just as Turkish President Recep Tayyip Erdogan was shocked by Trump’s sudden impositions of harsh sanctions this month, Qatar might also face a similar American reaction for going too far in its support for Turkey, or getting too close to Iran. In addition, Qatar must keep in mind that Turkey could never replace the U.S. as a partner both in terms of military protection or the advanced American oil and gas technology it receives. In other words, if Trump is willing to risk the United States’ relationship with Turkey so easily, Qatar should not assume that it is immune from his wrath – or could find as useful an ally. Perhaps a better strategy for Qatar is to maintain a balance between its two important allies.