Turkey has told its citizens visiting or living in Germany to "be careful" and keep their composure against "racist and xenophobic slurs" in advance of the country's upcoming federal elections.

"It is advised for our citizens in Germany or planning to visit this country to be even-tempered, keep themselves out of political discussions and absent themselves from rallies held by terrorist groups ahead of the elections," said the Turkish foreign ministry in a statement published on its official website on Saturday.

It also said political leaders in Germany were using anti-Turkey rhetoric in their election campaigns and voiced the aim of blocking Turkey from becoming a member of the European Union.

READ MORE - Erdogan - Era of bowing to Western pressure is over

"The political atmosphere in the aforementioned country is under the influence of far-right and racist propaganda," said the ministry.

"It is worrying that a chancellor-candidate political leader in Germany has recently made statements including clear racist elements and German officials took no measure about it."

Almost two weeks before the September 24 general elections, German Chancellor Angela Merkel and her centre-left rival Martin Schulz clashed over Turkey policy in a TV debate on Sunday night.

During the televised event, Schulz made a proposal to halt Ankara's EU membership talks and freeze 4 billion euros ($4.68bn) in pre-accession funds.

Last month, Turkish President Recep Tayyip Erdogan called on ethnic Turks living in Germany to vote for those who are "not hostile to Turkey" in the elections.