However, these relations have hit rock bottom after the failed coup of July 2016 in Turkey, Ankara accusing its european allies of a lack of solidarity after the putsch.
Ties between the two North Atlantic Treaty Organisation countries soured after Berlin criticized Ankara's crackdown on opponents following a failed 2016 coup, which saw tens of thousands arrested.
"We want our German friends to continue reposing trust in Turkey, Turkish economy and our country's future", Erdogan said.
The inauguration on Saturday capped a controversial three-day state visit aimed at repairing frayed ties with Berlin after two years of tensions. German Chancellor Angela Merkel did not attend the banquet but no official reason was given for her absence.
"The two parties are willing to move forward to get out of the impasse", said Ilke Yoygur, an analyst at the Elcano Royal Institute in Madrid.
"In a critical period, we have made a fruitful, successful visit to Germany", Erdogan told guests at the opening of the Central Mosque.
Erdogan noted that although there are now a number of problems between the U.S. and Turkey, Washington will finally make an important and correct choice.
He noted that Turkey lifted the state of emergency following the June 24 presidential and parliamentary elections in the country.
At a state dinner Friday with German President Frank-Walter Steinmeier, Erdogan alluded to the "hundreds, thousands", of terrorists living in Germany.
Merkel also announced that she planned to take part later in October in an Istanbul summit hosted by Erdogan on the crisis in Syria which also aims to include French President Emmanuel Macron and Russia's Vladimir Putin.
Relations between Berlin and Ankara have deteriorated due to the arrest of German citizens in Turkey.
"But, we will never allow anyone to violate our rights, laws, and interests [in our region]", Erdogan said, Anadolu Agency reported.
"It will be a long and arduous road toward normalisation", he said.