COLOGNE, Germany -- Thousands rallied in the German city of Cologne on Sunday to denounce the failed July 15 coup in Turkey and show support for Turkish President Recep Tayyip Erdogan.

A heavy police presence protected demonstrators. The rally came amid tensions among Turks following the coup attempt and concern in Germany over the scale of the Turkish government's subsequent crackdown on those it says are linked to a U.S.-based cleric it blames for the coup attempt. The cleric, Fethullah Gulen, has denied the claims.

Police said some 20,000 people gathered in wet weather Sunday afternoon at the riverside rally, across the Rhine from downtown Cologne. Many waved Turkish flags.

Germany is home to roughly 3 million people with Turkish roots.

Organizers at the rally played the Turkish and German national anthems and held a minute of silence for the people killed in the attempted coup. The slogan of the demonstration was "Yes to democracy. No to the coup."

Police put 2,700 officers in place to prevent any trouble. Four much smaller counter-protests took place elsewhere in the city, including one by a far-right German group that was kept well away from the Turkish rally.

Some demonstrators came from outside Germany, such as French-Turkish protester Aziz Sahin, who said he came from Paris "just to support democracy."

A regional court imposed the condition that no messages from speakers elsewhere -- such as politicians in Turkey -- could be shown on a video screen at the rally. Germany's highest court rejected a complaint against that ban on Saturday night.

Erdogan's spokesman, Ibrahim Kalin, said ruling prevented the president from sending a message to the rally, and called for a "satisfactory explanation" from German officials.

Later Sunday, organizers read a message from Erdogan thanking people with Turkish roots in Germany for their moral support during the coup attempt, the German news agency dpa reported. He said "today Turkey is stronger than it ever was before July 15."

Foreign Minister Frank-Walter Steinmeier said ahead of the rally that there is "no place in Germany" for anyone or group to "bring domestic political tensions from Turkey to us in Germany."