The sweeping purge of soldiers and officials in the wake of the failed coup in Turkey is likely to be conducted with extra vigour because a number of close associates of President Recep Tayyip Erdogan are among the 265 dead. The number of people detained so far is at 6,000 including soldiers, and around 3,000 judges and legal officials who are unlikely to have been connected to the attempted military takeover.

On Sunday, Erdogan attended the funeral of the elder brother of his chief adviser, Mustafa Varank. Varank’s older brother, Dr Ilhan Varank, studied at Ohio State University, and was the chairman of Computer and Technology Education Department at Istanbul’s Yildiz Technical University, according to Anadolu Agency (AA). It says that the 45-year-old was shot at and killed as he demonstrated in front of the Istanbul Municipality building on the night of the coup, 15 July.

Another name close to Erdogan, Erol Olcak, was shot and killed along with his 16-year-old son at the Bosphorus Bridge, local media reported. Having met the president many years ago when they both belonged to the same Islamic party known as Prosperity Party, Olcak became a prominent name in AKP’s media and publicity campaigns since the party was founded in 2001. Olcak and his son were at the Bosphorus Bridge to protest the coup attempt when they were shot by soldiers.

The coup plotters clearly saw the importance of detaining or eliminating Erdogan but were unable to find him at the holiday resort of Marmaris, in south west Turkey, where he was staying, as is shown by the film of shootings there. They also tried to target his most important aides by taking them into custody. His secretary Fahri Kasirga was taken prisoner by rebel soldiers, according to his son, who tweeted on the night of the coup that “they wanted [pro-coup forces] to force my father to stay in his house, but when he resisted, the bloody traitors took him into an ambulance and drove off.” The story is confirmed by Erdogan himself who said as he headed to the airport at Marmaris that “they took my secretary. What are you going to do with my secretary?”

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

The failed coup is serving as an excuse for a massive round-up of members of the judiciary and army officers, far greater than anything seen in Turkey for years, and is presumably a bid to secure Erdogan’s grip on the Turkish state. So numerous are those detained that a sports stadium is being used to hold some of them, a development that has ominous similarities with mass arrests in South American coups in the last century. Some 140 out of 387 judges in the Court of Appeal have been detained along with 48 out of 156 from the Council of State.

Erdogan: Turkey coup bid 'an act of treason'