ANKARA (Reuters) - Turkey cautioned its citizens on Saturday to take care when traveling to Germany, citing what it said was an upswing in anti-Turkish sentiment ahead of a German national election later this month.

FILE PHOTO: German Chancellor Angela Merkel greets Turkey's President Recep Tayyip Erdogan at the beginning of the G20 summit in Hamburg, Germany, July 7, 2017. REUTERS/Bernd Von Jutrczenka/POOL/File Photo

The advisory is likely to further exacerbate tensions between the two NATO allies, whose ties have soured following last year’s failed coup against Turkish President Tayyip Erdogan and his subsequent crackdown on alleged coup supporters.

“The political leadership campaigns in Germany are based on anti-Turkey sentiment and preventing our country’s EU membership. The political atmosphere... has actually been under the effects of far-right and even racist rhetoric for some time,” Turkey’s foreign mininstry said in a statement.

Last weekend German Chancellor Angela Merkel said during a televised election debate that she would seek an end to Turkey’s membership talks with the European Union, in an apparent shift of her position that infuriated Ankara.

Merkel, whose conservative Christian Democrats (CDU) have long been skeptical about Turkey’s EU ambitions, is expected to win a fourth term in office in Germany’s Sept. 24 election.

“Turkish citizens who live in, or who plan to travel to, Germany should be cautious and act prudently in cases of possible incidents, behavior or verbal assaults of xenophobia and racism,” the foreign ministry said.

The advisory marks a reversal of roles. Earlier this year Germany warned its own citizens traveling to Turkey about increased tensions and protests ahead of a Turkish referendum on April 16 which considerably expanded Erdogan’s powers.

Merkel and other EU leaders have strongly criticized Erdogan’s actions since the failed coup, saying his purges of Turkey’s state institutions and armed forces amount to a deliberate attempt to stifle criticism.

More than 50,000 people have been detained and 150,000 suspended in the crackdown, including journalists and opposition figures. Some German nationals have also been targeted.

Turkey says the purges are necessary given the extent of the security threat it faces.