Turkish President Recep Tayyip Erdogan has said German Chancellor Angela Merkel is an enemy of Turkey.

Mr Erdogan has also called on Turks in Germany to vote against her and other major parties in next month's elections.

The comments are some of his harshest yet against Ms Merkel and her Christian Democrats, illustrating the widening divide between the NATO allies and major trade partners.

Ties between the two nations have been strained in the aftermath of last year's failed coup as Turkish authorities detained more than 50,000 people and sacked or suspended 150,000, drawing criticism from Europe.

Mr Erdogan, who has little patience for Western criticism, has accused Germany of anti-Turkish sentiment.

"I am calling on all my countrymen in Germany: the Christian Democrats, SDP, the Green Party are all enemies of Turkey. Support those political parties who are not enemies of Turkey," he said in comments after Friday prayers in Istanbul.

"I call on them not to vote for those parties who have been engaged in such aggressive, disrespectful attitudes against Turkey, and I invite them to teach a lesson to those political parties at the ballot box," he said.

Germany, which has a large Turkish diaspora, goes to the polls on 24 September for elections where Ms Merkel is running for a fourth term.

Tensions between the two countries have been also been strained as German nationals - including a journalist and a rights activist - have been caught up in Mr Erdogan’s crackdown.

Ms Merkel has said there would be no expansion of a customs union or deepening in EU-Turkish ties, comments which infuriated Turkey.

Mr Erdogan said her remarks on the customs union showed Germany had become a country that violates the European Union's acquis, or body of law.

German Foreign Minister Sigmar Gabriel has hit out at "interference" in German affairs following the remarks.

"That is an unprecedented act of interference in the sovereignty of our country," he said, adding that Erdogan's interference in Germany's electoral campaign shows that he wants to incite people in Germany against each other."