The unfolding Gulf diplomatic crisis earlier this month has managed to put old alliances and partnerships to the test, while also revealing new ones.
Shortly after Saudi Arabia, Egypt, Bahrain and the United Arab Emirates severed diplomatic relations with Qatar and closed their airspace to commercial flights, Turkey condemned the blockade against Qatar, sent food stocks to stave off possible shortages in the country, and fast-tracked legislation through parliament to deploy Turkish troops on Qatari soil.
On June 7, Turkey's parliament ratified two bills; one allowing the deployment of Turkish troops in Qatar and another approving an accord between the two countries on military training cooperation.
"A very grave mistake is being made in Qatar, isolating a nation in all areas is inhumane and against Islamic values. It's as if a death penalty decision has been taken for Qatar," Turkish President Recep Tayyip Erdogan told members of his ruling Justice and Development Party (AKP) in Ankara last week.
Both agreements were drawn up before the spat between Qatar and its neighbours erupted and were brought to parliament by AKP MPs in an extraordinary session.
A key ally of Qatar, Turkey is setting up a military base in the country - the first Turkish overseas military installation in the Middle East. Qatar also hosts the largest US airbase in the Middle East, Al-Udeid, where around 10,000 military personnel are stationed.
The defence cooperation between Doha and Istanbul dates back to 2014, when the two nations signed an agreement aimed at helping them confront "common enemies".
Both nations have provided support for the Egyptian uprising and condemned the military coup that brought the country's current leader, Abdel Fattah el-Sisi, to power.
Besides allowing for a Turkish military base in Qatar, which would primarily serve as a venue for joint training exercises, the deal also gave Qatar the option of setting up a similar facility in Turkey.
In an interview with Reuters in late 2015, Ahmet Demirok, Turkey's ambassador to Qatar at the time said 3,000 Turkish ground troops would be eventually stationed at the base, as well as air and naval units, military trainers and special operations forces.
In 2016, then Turkish Prime Minister Ahmet Davutoglu visited the base where 150 troops were already stationed, according to the Turkish daily, Hurriyet.
It is reported that 200 Turkish troops are currently deployed in the base, which has the capacity to accommodate up to 5,000 troops, but it remains unclear when the base would be completed.
The defence partnership agreement came at a time of increased regional instability in the face of a perceived waning of US interest in the region.
But Turkey's involvement in the recent spat between Qatar and its neighbours marks the latest demonstration of the country's departure from its traditional "soft power" policy approach towards regional affairs, reflecting an increased desire by the AKP to expand Turkey's influence as a powerful player in the regional and global arena.
Furthermore, Turkey's disputes with several of its fellow NATO partners have prompted Ankara to seek new partnerships and diversify its alliances to counterbalance the country's dependence on its traditional Western allies.
Turkey already has a presence in Afghanistan, Iraq, Bosnia and Kosovo whether through peacekeeping, humanitarian or other missions. In addition, Turkey is also reportedly setting up a military training camp - said to be its largest overseas facility - this year in Mogadishu, Somalia. The camp will be used to train Somali soldiers in the fight against the al-Shabab group.
This is in addition to Turkey's military adventures in northern Syria where it has been shelling both the Islamic State of Iraq and the Levant (ISIL, known as ISIS) fighters and Kurdish rebels of the Popular Protection Units (YPG). The country is also involved militarily in northern Iraq and in the battle for Mosul against ISIL.
More recently, it emerged that Turkey also offered to build a military base in Saudi Arabia shortly after work began on its facility in Qatar in 2014 - a demand which Saudi Arabia rejected.
As Ankara looks to stretch its military presence across Arab and African soil, a deepening strategic alliance with Qatar - one of the world's largest exporters of natural gas – fits the country's foreign policy aspirations and boosts its $857bn economy.
"The military base in Qatar is an important power projection asset for Turkey," Can Kasapoglu, a defence analyst from Turkey's EDAM, told Al Jazeera in an earlier interview.
"This indeed suggests that Turkey sees its defence ties with Qatar as an indispensable pillar of its strategic posture in the region," said Kasapoglu. "It also shows that Ankara would not drastically alter its long-term vision for regional fluctuations."
For Qatar, defence cooperation with Turkey would reduce the nation's complete dependency on US, especially with the current US administration, whose policy on the Middle East remains ambiguous.
The defence agreement defines the objective of the mission as "developing Qatar's defensive ability" to carry out joint training and exercises, as well as "missions the two countries agree on."
Nevertheless, the GCC crisis has put Turkey in a delicate position, as the country has long maintained good relations with the other Gulf states and has sought to solidify military links with several of them.
As Turkey tried to defuse the diplomatic dispute and position itself as a mediator, the country defended Doha from the beginning and called out Gulf leaders to end the blockade while falling short of appearing to take an anti-Saudi stance.
But as the crisis enters its third week, the prospects of Ankara maintaining close ties with Saudi Arabia and Qatar at the same time are becoming more complicated.
Source: Al Jazeera News