Turkey's president has accused the West of “supporting terrorism” and said the coup in his country was organised by foreign powers.

Recep Tayyip Erdogan suggested Turkey would be unable to continue its strategic allegiance with the US if it continues to “harbour” the exiled cleric Fethullah Gulen, who is accused by the Turkish government of instigating the coup attempt.

And he also took aim specifically at Germany, after a German court ruled against allowing him to appear on a video link to address a crowd of about 30,000 supporters and anti-coup demonstrators in Cologne over the weekend.

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

In an address for foreign investors in Ankara which was broadcast by the TRT network, Mr Erdogan said: “I have to say that this was done by foreign powers. This was not done only domestically…the scenario was written outside of Turkey.”

He repeated a complaint that no foreign leader had visited Turkey since the failed coup on 15 July, which left more than 270 people dead.

He also said Turkey had sent Germany more than 4,000 files on what he said were wanted terrorists, but the country did nothing.

“The West is supporting terrorism and taking sides with coups,” he said. “Those we considered friends are siding with coup-plotters and terrorists.”

Turkey's President Erdogan defends government action

Turkey has demanded the extradition of Mr Gulen, who the government says instigated the coup, but Washington has asked for evidence of the cleric's involvement, saying the extradition process must take its course.

Mr Erdogan complained about the request for evidence, saying: “We did not request documents for terrorists that you wanted returned.”

Justice minister Bekir Bozdag has sent a second document to the United States seeking Mr Gulen's arrest, the state-run Anadolu news agency said. The minister said the second letter explained why there was an urgent need for the arrest.

“They requested certain information following our first letter; we provided answers to the question 'why is it urgent’,” Anadolu quoted Mr Bozdag telling reporters in parliament, adding Turkey had intelligence indicating Mr Gulen might leave for a third country.

“I hope that the United States decides in Turkey's favour, in line with democracy and the rule of law, and returns this leader of a terror organisation to Turkey,” he said.