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

Recep Tayyip Erdogan suggested Turkey would be unable to continue its strategic allegiance to 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 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 has demanded the extradition of US-based Muslim cleric Fethullah 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 favor, in line with democracy and the rule of law, and returns this leader of a terror organization to Turkey," he said.