On the final day before heading into its summer recess, the Bundestag passed legislation imposing restrictions on members of governments from non-EU countries holding political rallies in Germany. Foreign leaders will need to apply for permission to hold such events, and permission will be "fundamentally refused," if elections or referenda are scheduled in the home country within three months of the leader's visit to Germany.

The rule will apply generally, but it's been nicknamed the "lex Erdogan" or Erdogan law. Ahead of next week's G20 summit of the world's leading nations in the northern German city of Hamburg, Ankara had mooted the idea of the Turkish president addressing supporters among Germany's large Turkish minority.

A matter of German foreign policy interests

Ahead of the law's passage, the German government, which has been engaged in a war of words with the Turkish leader for several months, said it wouldn't allow Erdogan to hold a rally in Hamburg. One of the first leaders to denounce the idea was Foreign Minister Sigmar Gabriel, who again justified the German government's policy on Friday.

"Whether or not a foreign politician is allowed to speak in Germany is a question not of freedom of speech but of Germany's foreign policy interests," Gabriel said at a Q&A session with foreign journalists in Berlin. "The conflicts with Turkey at the moment are so great that we think it's inadvisable to - how should I put this - pour more oil on the fire."

Gabriel said there had only been a low-level inquiry about the possibility of Erdogan holding a rally in Hamburg and not an official Turkish government request. Gabriel added that he hoped that would defuse the situation.

Erdogan caused outrage in March with his Nazi Germany comparisons

A response to an insult

The majority of Germany's many disputes with Turkey at present are related specifically to the country's president. Berlin has objected to Erdogan's harsh treatment of intellectuals and journalists, including German citizen Deniz Yucel, who is imprisoned in Turkey. Germany did not support the Turkish referendum in April that gave the Turkish president vastly enhanced powers, and Berlin was none too pleased about Erdogan followers' often heavy-handed attempts to rally support among the 1.4 million Turks in Germany eligible to vote in it.

As relations between Berlin and Ankara deteriorated, Erdogan lashed out, comparing the current German government to Nazi Germany. Gabriel said Friday's law was a reaction to that scandal.

"We've drawn the consequences from our experiences in the previous [Turkish] campaign, in which this country was described as Nazi Germany," Gabriel asserted. "That accusation caused deep injury, and we've drawn the consequences. Not just concerning Turkey, but all countries that aren't part of the European Union."

Gabriel, who was previously married to a Turkish woman, said the law was intended to protect the millions of people in Germany who either are Turkish citizens or come from Turkish backgrounds.

"What we don't want is for domestic conflicts in Turkey to be imported into our society," Gabriel told the foreign journalists.

Read more: Did Turkey order spying in German classrooms?

Turkey wants to see Germany do more against followers of Fethullah Gulen

Mistakes and mistaken theories

The most recent chapter in the Turkish-German rancor centers on Ankara's belief that Germany has not offered enough support against enemies of the Erdogan government, from the Kurdish separatist PKK party to the Gulen movement.

Gabriel said Germany had not reacted adequately to a putsch attempt last summer that the Turkish government blames on the movement connected to the US-based cleric.

"I think we should have been more direct in expressing our condemnation of the putsch and our solidarity with the Turkish government and people," Gabriel admitted. "I think we made a mistake. I think what the Turkish people expected was an emotional opening up toward Turkey."

Read more: Real and imagined threats: the shared past of AKP and the Gulen movement

Gabriel added that he supported Turkish calls to prevent public expressions of support in Germany for the PKK, which is classified as a terrorist organization.

Turkey would like Germany to arrest and deport Gulen supporters whom it considers terrorists. Gabriel said Turkey didn't appreciate that the German government doesn't simply order people to be apprehended and extradited. The lack of understanding of the separation of powers and the rule of law in Germany, the foreign minister suggested, had resulted in a mistaken belief in Turkey that Germany was somehow hostile to the country and its leadership.

"There's a conspiracy theory," Gabriel said. "There's the assumption that there's a plot to systematically disadvantage Turkey. I regret that we haven't been able to convince them that there's no such thing."

Gabriel added that Berlin had no interest in further escalating the conflict. But how well Turkey takes the so-called "Erdogan law" will be apparent - at the very latest - when the Turkish president comes to Hamburg for the G20 summit on July 7 and 8.