Earlier this week, Sigmar Gabriel criticized Ankara over allegedly aiming to interfere in the German election by calling on ethnic Turks to vote against two ruling parties headed by Chancellor Angela Merkel and former European parliament President Martin Schulz. The German foreign minister described Ankara's actions as an "unprecedented act of interference" in the country's sovereignty.
"He knows no limits! Who are you to talk to the president of Turkey? Know your limits. He is trying to teach us a lesson… How long have you been in politics? How old are you?" Erdogan said on Saturday, while addressing supporters at a rally.
"They are waging a campaign against Turkey. Vote for those who don't have enmity towards Turkey," the Turkish president said.
He also apparently commented on Turkey's decades-long bid for membership in the EU by saying that "it's not important for us whether Germany opens its doors to us or not. We have enough doors."
The relations between Berlin and Ankara have soured in recent months after Germany banned several Turkish officials from coming to the country to campaign for Erdogan ahead of a referendum that granted him more executive powers. Erdogan then compared the authorities in Berlin with Nazis.
In May, Ankara canceled a German delegation's visit to the Incirlik military airfield in Turkey, where German military personnel and jets were stationed, the day before the visit was scheduled to begin. In early June, Berlin responded to Ankara's move by announcing the withdrawal of its troops from the base, which started in July.