TURKEY’S combative president Recep Erdogan lost no time in cracking down on his enemies after a failed coup at the weekend.

The Turkish government detained 2,839 military personnel suspected of taking part in the putsch. At the same time, 2,745 judges were told not to bother coming in for work this morning.

There are moves to reinstate the death penalty for plotters and the government is demanding President Obama hand over the man it believes is responsible, US-based Turkish cleric Fethullah Gulen.

Mr Gulen, who strongly denies any involvement, split from Mr Erdogan in 2013 and leads a Turkish protest movement in exile.

Yesterday the president described the uprising as “a gift from God to us because this will be a reason to cleanse our army”.

The West has a complicated relationship with Turkey. It is the frontline in the fight against Isis and a bulwark against refugees fleeing to Europe. It is also the region where dozens of oil and gas pipelines intersect.

It has the second-largest standing army in Nato, beaten only by the United States, and a thriving economy. Turkey should be a key ally against radicalism and a trusted partner on the world stage; and yet there is also a palpable growing sense of unease in the West.

After years of waiting patiently to join the EU, President Erdogan has suddenly gone cool on the idea. To the West’s apparent surprise he has patched up relations with Russia, which hit rock bottom when Turkey shot down a Russian warplane last year.

President Putin was one of the first people Mr Erdogan called after the failed uprising. The Americans had seen the power cut to the US air base at Incirlik and the Turkish base commander arrested.

If Mr Erodogan tells the US air force to leave Turkey the West will lose its best platform for attacking Isis in Syria. At a stroke, America’s terrorism containment strategy will be in ruins. Turkey’s instability is very much the West’s problem as well.