In early June, Turkish President Recep Tayyip Erdogan hosted German Foreign Minister Sigmar Gabriel and made an unusual offer, according to German officials briefed on the exchange: extradite two Turkish generals who had applied for asylum in Germany, and receive a detained German-Turkish journalist in return.

According to the German officials, Berlin rejected the offer. A senior Turkish official, meanwhile, denied it was ever made and officials at the Turkish president’s office didn’t respond to requests for comment. But that meeting did nothing to soothe the strain in one of Europe’s most important alliances.

After a year of slights, barbs and misunderstandings, both sides are now girding for a showdown that could rattle the European Union, alter the fight on terrorism and escalate the refugee crisis.

Turkey has made some efforts to calm the waters in recent days, but tensions continued to run high this week. Mr. Erdogan said in parliament that if any country implemented economic sanctions against Turkey, as Germany had threatened to do, “you’ll have to take bigger consequences into account.” A Turkish pro-government newspaper put a swastika on Chancellor Angela Merkel on its front page. The headline: “Worse than Hitler.”

German officials and politicians say they are prepared for the spat to get worse. Advisers who can moderate Mr. Erdogan, they say, have lost virtually all influence in Ankara; and Turkey’s ambition to become a bigger player in the Middle East in its own right diminishes the weight placed by Turkish leaders on good ties with the EU, they say.