The murderous attack on Istanbul airport, killing 41 people, came hours after Recep Tayyip Erdogan had arranged a telephone call with Vladimir Putin. It was going to be their first conversation since the shooting down by the Turks of a Russian jet seven months ago. It was also a crucial part of a concerted diplomatic campaign by Ankara to repair badly damaged relations with countries in the region.

Turkey has just re-established diplomatic relations with Israel, six years after 10 Turkish citizens were killed when their aid ship bound for Gaza was stormed by Israeli forces. Moves are under way for rapprochement with Egypt whose president, Abdel Fattah el-Sisi, had been repeatedly attacked by Mr Erdogan over the coup which overthrew the Muslim Brotherhood government backed by Ankara.

The Turkish president has been increasingly isolated abroad while facing rising protests at home over his authoritarian policies as well as an increasingly bloody conflict with the Kurdish PKK and the Islamist terrorists of Isis.

Download the new Independent Premium app Sharing the full story, not just the headlines

On foreign relations, Mr Erdogan has had to climb down in his confrontation with Russia, sending “a letter expressing deep sorrow” over the downing of the Su-24 plane, after adamantly refusing to countenance anything approximating an apology in the past. He has made an agreement with Israel for some Turkish aid to get through to Gaza, although he has failed in his pledge to ensure that the blockade of the Strip by Israel and Egypt is lifted.

Binali Yildirim, who became the Turkish prime minister after Ahmet Davotoglu, the previous holder of the post was forced to resign by Mr Erdogan, wanted to stress. “We aim to improve our relations not only with Russia and Egypt but also with all countries around the Black Sea and Mediterranean. As Turkey, our basic principle is to want for others what we want for ourselves.”

Ankara had faced criticism for carrying out few air strikes against Isis, focusing instead on the PKK and has also, on occasions, bombed the Syrian Kurdish group, YPG, a key ally of the Americans against Isis.

The Turks have not scaled down their military action against the Kurds. But they have agreed to allow their Nato allies to run more flights along the border with Syria in operations against Isis. The Erdogan government also claims that it is now cracking down on Isis, pointing to the fact that 36 suspects are facing a total of 11,750 years in prison for a bomb attack in Ankara last year which killed 103 people and injured 250 others.

But Turkey has been, at best, ambivalent towards Islamist groups, including Isis, fighting the forces of Bashar al-Assad in Syria. Evidence has emerged that the country’s intelligence service, MIT, had facilitated arms supplies to Islamists. Turkish journalists, meanwhile, have been charged by the government for exposing the scandal.

Shape Created with Sketch. Attack at Ataturk International airport in Istanbul Show all 20 left Created with Sketch. right Created with Sketch. Shape Created with Sketch. Attack at Ataturk International airport in Istanbul 1/20 A mother of victims reacts outside a forensic medicine building close to Istanbul's airport AFP/Getty Images 2/20 Broken windows are pictured at the attacks and explosions site in Ataturk airport's international arrivals terminal AFP/Getty Images 3/20 Bullet impacts are pictured at Ataturk airport AFP/Getty Images 4/20 Police officers patrol at Istanbul Ataturk airport Reuters 5/20 Workers clean the debris from the blasts at Istanbul Ataturk airport Getty Images 6/20 A wounded girl from the Ataturk Airport suicide bomb attack is transported to the Bakirkoy Sadi Konuk Hospital Getty Images 7/20 Passengers embrace outside Ataturk airport`s main entrance in Istanbul AFP/Getty Images 8/20 Medics carry wounded people to a hospital after a suicide bomb attack at Ataturk Airport in Istanbul EPA 9/20 Relatives of the Ataturk Airport suicide bomb attack victims wait outside Bakirkoy Sadi Konuk Hospital Getty Images 10/20 A Saudi tourist who survived the Ataturk Airport suicide bomb attack waits for his wounded mother outside the Bakirkoy Sadi Konuk Hospital Getty Images 11/20 A Turkish riot police officer patrols Ataturk airport`s main entrance in Istanbul Ozane Kose/AFP/Getty Images 12/20 Passengers wait at Ataturk airport`s main enterance in Istanbu, after two explosions followed by gunfire hit Turkey's largest airport Ozan Kose/AFP/Getty Images 13/20 Forensic police work the explosion site at Ataturk airport Ozane Kose/AFP/Getty Images 14/20 Passengers leave Istanbul Ataturk, after a suicide bomb attack Getty 15/20 Armed security man escorts people from a car park at Istanbul Ataturk airport REUTERS 16/20 Armed security walks at Istanbul Ataturk airport Murad Sezer/REUTERS 17/20 Ambulance cars arrive at Istanbul Ataturk airport Osman Orsal/REUTERS 18/20 An ambulance arrives at the Ataturk airport REUTERS 19/20 The weapons used in the attack REUTERS 20/20 Passengers leave Istanbul Ataturk, after a suicide bomb attack Getty 1/20 A mother of victims reacts outside a forensic medicine building close to Istanbul's airport AFP/Getty Images 2/20 Broken windows are pictured at the attacks and explosions site in Ataturk airport's international arrivals terminal AFP/Getty Images 3/20 Bullet impacts are pictured at Ataturk airport AFP/Getty Images 4/20 Police officers patrol at Istanbul Ataturk airport Reuters 5/20 Workers clean the debris from the blasts at Istanbul Ataturk airport Getty Images 6/20 A wounded girl from the Ataturk Airport suicide bomb attack is transported to the Bakirkoy Sadi Konuk Hospital Getty Images 7/20 Passengers embrace outside Ataturk airport`s main entrance in Istanbul AFP/Getty Images 8/20 Medics carry wounded people to a hospital after a suicide bomb attack at Ataturk Airport in Istanbul EPA 9/20 Relatives of the Ataturk Airport suicide bomb attack victims wait outside Bakirkoy Sadi Konuk Hospital Getty Images 10/20 A Saudi tourist who survived the Ataturk Airport suicide bomb attack waits for his wounded mother outside the Bakirkoy Sadi Konuk Hospital Getty Images 11/20 A Turkish riot police officer patrols Ataturk airport`s main entrance in Istanbul Ozane Kose/AFP/Getty Images 12/20 Passengers wait at Ataturk airport`s main enterance in Istanbu, after two explosions followed by gunfire hit Turkey's largest airport Ozan Kose/AFP/Getty Images 13/20 Forensic police work the explosion site at Ataturk airport Ozane Kose/AFP/Getty Images 14/20 Passengers leave Istanbul Ataturk, after a suicide bomb attack Getty 15/20 Armed security man escorts people from a car park at Istanbul Ataturk airport REUTERS 16/20 Armed security walks at Istanbul Ataturk airport Murad Sezer/REUTERS 17/20 Ambulance cars arrive at Istanbul Ataturk airport Osman Orsal/REUTERS 18/20 An ambulance arrives at the Ataturk airport REUTERS 19/20 The weapons used in the attack REUTERS 20/20 Passengers leave Istanbul Ataturk, after a suicide bomb attack Getty

The question is whether Ankara would be able to combat Isis even if it went after it with full energy. A large number of Turks are among the foreign fighters which have been fighting with the group in Syria and some of them are now slipping back across the frontier and finding shelter with sympathisers.

The threat is not just from Isis, but a group calling itself Kurdistan Freedom Hawks, an offshoot of the PKK. Less than a month ago it carried out a suicide bombing in the Istanbul district of Vezneciler, killing 12 people. It had previously claimed responsibility for two car bombings in Ankara in April, taking 29 lives.

Daily coronavirus briefing No hype, just the advice and analysis you need Enter your email address Continue Continue Please enter an email address Email address is invalid Fill out this field Email address is invalid Email already exists. Log in to update your newsletter preferences Register with your social account or click here to log in I would like to receive morning headlines Monday - Friday plus breaking news alerts by email Update newsletter preferences

One reason for the Turkish attempts to mollify the Kremlin — with Mr Erdogan saying he was “ready for any initiatives to relieve the pain and severity of the damage done” over the aircraft – was the severe impact on his country’s economy from sanctions imposed by a furious Mr Putin, in particular a ban on visits by Russian tourists.

The assault on Ataturk Airport, the third largest in Europe, and a rapidly expanding transport hub, will further damage the tourist trade, something Isis has threatened to do. And, after the Vezneciler bombing TAK warned foreign visitors to keep away, saying: “Turkey is no longer safe for them.”

The foreign and domestic policies of President Erdogan have both ended up having highly damaging effects on one of the key planks of the country’s economy.