Turkish leaders are fearful that there may be a second attempt at a military uprising in Turkey following the failure of the recent coup. Several important military units are confined to their bases and President Recep Tayyip Erdogan has been slow to return to Ankara from Istanbul, apparently because the capital has not been deemed completely secure.

Fears of a second coup attempt stem from the realisation by the Erdogan administration that the infiltration by pro-coup forces of the senior ranks of the 600,000-strong armed forces and intelligence apparatus went far deeper than originally suspected. Some 85 generals and admirals or almost a quarter of the total of 375 were jailed on Tuesday by a court, a sign that the government privately believes that the plot involved many more senior officers than the small clique it has publicly claimed was behind the abortive putsch. Other sources suggest that the true figure for generals detained is 125.

Arrests at a high level are continuing with Mr Edrogan’s advisor on the air force, Lt Col Erkan Krivak, arrested on Tuesday. Soldiers from the Second Army, which is fighting a widespread Kurdish rebellion in the south east of the country, have been ordered to stay in their camps in the embattled region. The Second Army commander, General Adem Huduti, is the most senior military commander arrested. The gates into the main base of the 3rd Corps in Istanbul, theoretically part a Nato rapid reaction force, are blocked by municipal dump trucks and heavy vehicles according to eye witnesses.

“They are fearing another attempt at a coup,” says Asli Aydintasbas of the European Council on Foreign Relations in Istanbul, pointing to the extensive nature of the purge of the senior officer corps and judiciary, a quarter of whose members have been dismissed. Those arrested for secretly backing the original coup include some from Mr Erdogan’s inner circle such as Ali Yazici, his military secretary. Soli Ozel, professor of internationals relations at Kadir Has University in Istanbul and a columnist at Haberturk newspaper, says that “the number of Manchurian Candidates” in the upper ranks of the government is extraordinary – a reference to the film about secret agents and “sleepers” who infiltrated the top political leadership in the US in the 1950s at the height of the Cold War.

A history of Turkish coups

The sweeping purge carried out by Mr Erdogan and his administration is being interpreted by many Turks and foreign governments as an opportunistic attempt to get rid of everybody not obedient to Mr Erdogan and the ruling Justice and Development Party (AKP). The Board of Higher Education dismissed 1,577 university deans on Tuesday and the Ministry of National Education said that it had sacked 15,200 for connections to the movement of the self-exiled Muslim cleric Fetullah Gulen which is accused of orchestrating the original coup. Mr Gulen and his supporters have publically denied any connection to the attempted coup.

It is true that Mr Erdogan and his administration evidently see the coup as an excuse to cleanse the army, state apparatus and civil service of all who are not loyal to them. But government officials genuinely believe that there is a very widespread conspiracy by Gulenist “sleeper” agents, not all of whom have been detected and may still be capable of armed action. When the Gulenists were allied to the AKP seven or eight years ago, they were at the cutting edge of a purge of the armed forces of secular sympathisers and were well placed to replace those dismissed or jailed by their own cadres. The AKP appears to have known about some but not all of these Gulenist networks which is why it is now casting the net so wide.

While the government wants to give the impression that the pro-coup forces have been wiped out, its restrictions on the movement of military formations are a sign that it is not yet confident that this is so. “The government has committed all the resources it is left with to deal with the fall out from the coup,” says Prof Serhat Guvenc of the Department of International Relations at Kadir Has University. “The country looks very vulnerable.” He believes the coup on 15 July was bound to fail once soldiers had fired on the protesters and bombarded the parliament building in Ankara, but says the present situation is chaotic and difficukgt to undertsand.

In pictures: Turkey coup attempt Show all 17 1 /17 In pictures: Turkey coup attempt In pictures: Turkey coup attempt Turkish President Erdogan attends the funeral service for victims of the thwarted coup in Istanbul at Fatih mosque on July 17, 2016 in Istanbul, Turkey Burak Kara/Getty Images In pictures: Turkey coup attempt Soldiers involved in the coup attempt surrender on Bosphorus bridge with their hands raised in Istanbul on 16 July, 2016 Gokhan Tan/Getty In pictures: Turkey coup attempt A civilian beats a soldier after troops involved in the coup surrendered on the Bosphorus Bridge in Istanbul, Turkey, 16 July, 2016 REUTERS/Murad Sezer In pictures: Turkey coup attempt Surrendered Turkish soldiers who were involved in the coup are beaten by a civilian Reuters In pictures: Turkey coup attempt Soliders involved in the coup attempt surrender on Bosphorus bridge Getty In pictures: Turkey coup attempt Supporters of Turkish President Recep Tayyip Erdogan wave flags as they capture a Turkish Army vehicle Getty In pictures: Turkey coup attempt People pose near a tank after troops involved in the coup surrendered on the Bosphorus Bridge in Istanbul, Turkey, 16 July, 2016 Reuters In pictures: Turkey coup attempt Turkish soldiers block Istanbul's Bosphorus Brigde Getty In pictures: Turkey coup attempt A Turkish military stands guard near the Taksim Square in Istanbul Reuters In pictures: Turkey coup attempt Pierre Crom/Twitter In pictures: Turkey coup attempt Turkish soldiers secure the area as supporters of Recep Tayyip Erdogan protest in Istanbul's Taksim square AP In pictures: Turkey coup attempt People demonstrate in front of the Republic Monument at the Taksim Square in Istanbul Murad Sezer/Reuters In pictures: Turkey coup attempt Turkish soldiers detain police officers during a security shutdown of the Bosphorus Bridge Reuters In pictures: Turkey coup attempt Turkish Army armoured personnel carriers in the main streets of Istanbul Getty In pictures: Turkey coup attempt Chaos reigned in Istanbul as tanks drove through the streets EPA/TOLGA BOZOGLU In pictures: Turkey coup attempt Turkish President Tayyip Erdogan speaks to media in the resort town of Marmaris Reuters In pictures: Turkey coup attempt Supporters of President Erdogan celebrate in Ankara following the suppression of the attempted coup Reuters

Prof Ozel says that Mr Erdogan may be a stronger leader because of what is seen as his heroic behaviour during the coup attempt, but he will be leader of a weaker state. He says that the Turkish Army “is like a man who has suffered a serious stroke and will be weakened for a long time afterwards”. Many senior military commanders may have equivocated during the critical hours of the coup while they waited to see which side would come out the winner.