Western diplomats are descending on Madrid for a long-awaited NATO summit. With Russia’s war raging in Ukraine, an increasingly assertive China, and both climate change and food shortages sowing unrest across the world, there is no shortage of hot-button issues on the agenda.

Yet there is one party around the table threatening to undermine the fragile unity of the military alliance. Turkey has in recent years become one of the bloc’s most awkward members, blowing hot and cold on relations with Moscow and refusing to impose sanctions over its invasion. Even before the current conflict, Ankara had attracted the ire of the US by buying Russian-made S-400 anti-air missile launchers, and was barred from acquiring advanced American F-35 fighter jets as a result.

Now the country and its veteran president, Recep Tayyip Erdoğan, are looking to make it clear to its allies that NATO needs Turkey more than Turkey needs NATO.

In the aftermath of Russia’s attack on its neighbour, traditionally neutral Finland and Sweden announced they had submitted applications to join the bloc. However, Ankara has put its foot down and declared it would veto their admission unless its concerns are addressed, namely the Nordic nations’ support for Kurdish separatists.

Copenhagen, in particular, has offered refuge to a sizeable Kurdish community, including dozens of alleged “terrorists” from the outlawed Kurdistan Workers Party (PKK) that Turkey says are responsible for a spate of bombings and paramilitary actions. Despite lodging ‘red notices’ with Interpol, Erdoğan’s government has had little success extraditing the suspects and several are believed to have received Swedish citizenship since then.

A number of EU nations have condemned Turkey for its crackdown on the Kurds, and for its escalating military operations in the Kurdish regions of Northern Syria. According to the US State Department, efforts in March to ban an opposition party Ankara says is linked to the PKK would “further undermine” Turkish democracy while Brussels claims is an act that “would violate the rights of millions of voters.”

But given any NATO member can object to new candidates, Sweden and Finland are finding they may have to compromise on their principles to get into the club. Ahead of the talks, which begin today, Turkey issued a list of 45 “terrorists” it expects to be repatriated, effectively amounting to an ultimatum. No response from the Scandinavian countries has yet been made public, but it is clear Erdoğan won’t give up without a fight.

“Turkey saw great leverage in the Finland and Sweden request,” an EU official told Foreign Policy this week. “They are trying to maximise this in the way that they always do.”

Likewise, there is growing pressure on Washington to reverse its decision to hold back its warplanes, despite receiving a $1.4 billion investment from Ankara. “Turkey’s not coming back into the F-35 program,” U.S. House Armed Services Committee Chairman Adam Smit said in June. In practice though, its demands can’t be dismissed if the US expects to get what it wants and extend NATO’s reach along Russia’s northern borders.

At the same time, the Ukraine war has been an opportunity for Erdoğan as much as it has been a challenge. Turkey has been hit with record inflation that experts say could be as high as 150 per cent – upending people’s lives and savings just a year before they are due to vote on their next president. But it has also created an air of crisis in which he has positioned himself as a tough talker who can deal with both the West and the East in an increasingly uncertain world.

Turkish Bayraktar drones have arrived in Ukraine to great fanfare, helping the Eastern European nation take out Russian tanks and artillery and showcasing the country’s growing military capabilities. Meanwhile, Ankara has hosted a series of as-yet unsuccessful peace talks between Moscow and Kyiv, and launched an effort to escort shipments of grain out of Ukraine’s blockaded ports and through the Black Sea.

As well as making Turkey invaluable to NATO militarily and diplomatically, the prospect of increased grain exports would help alleviate the pressures on businesses and potentially bring down food prices just as they seem increasingly debilitating. Like it or not, Erdoğan is an important player on the world stage and Turkey holds many of the cards.

While the NATO summit is likely to hear plenty of tough talk about democracy, liberty and values, in reality, making concessions to increasingly authoritarian Turkey is likely to be the only way its delegates can walk away with what they need to take on countries like Russia and China. For Western leaders, fighting battles inside the alliance is far harder when they are fighting a war outside of it.