President Recep Tayyip Erdoğan said Saturday his trip to Germany was "a very successful visit in a very critical period," despite the two countries' differences.
Speaking at the opening of a mosque in Cologne, Erdoğan said he had used his visit as an opportunity to discuss with local authorities "how to tackle racism and xenophobia."
He also met with business leaders to discuss potential investments in Turkey, he added.
"Putting aside some differences of opinion with Germany, we need to focus on joint issues," he said, citing the ongoing Syrian crisis and the the fight against the PKK terror group as areas requiring cooperation.
"Will not allow a handful of PKK and FETÖ (Gülenist Terror Group) sympathizer to disturb our people and harm Turkish-German friendship," Erdoğan added.
"We expect a more intense effort from our European friends against terror groups," the president said.
He said the streets and squares of the European capitals should not be "polluted" anymore with the symbols of PKK.
FETÖ and its U.S.-based leader Fetullah Gülen orchestrated the defeated coup of July 15, 2016, which killed 251 people and injured nearly 2,200 others.
In its more than 30-year terror campaign against Turkey, the PKK -- listed as a terrorist organization by Turkey, the U.S. and the EU -- has been responsible for the deaths of 40,000 people, including women and children.
Previously on Saturday, the president met with German Chancellor Angela Merkel at a working breakfast to discuss bilateral and international issues.
A German government spokesman told local media that the leaders discussed opportunities to "further strengthen the economic relations" between the two countries.
At the meeting, which lasted more than two and a half hours, the leaders also reviewed cooperation in addressing the refugee crisis, according to the spokesman.
Erdoğan was accompanied by Treasury and Finance Minister Berat Albayrak, Foreign Minister Mevlüt Çavuşoğlu, and Technology and Industry Minister Mustafa Varank.
It was Erdoğan and Merkel's second meeting during the president's high-profile state visit to Germany.
Security concerns and political disagreements forced a few last-minute changes to the president's schedule on Saturday, the final day of his three-day state visit to Germany.
After the breakfast meeting with Merkel, Erdoğan set off for Cologne to open the city's new Central Mosque.
The new religious center is run by the Turkish-Islamic Union for Religious Affairs (DITIB), a Turkish-German Muslim umbrella association representing around 900 Turkish Muslim groups in Germany. DITIB does community work and offers training for imams.
Plans for a large open-air event at the mosque were canceled late Friday by the city of Cologne, which cited security concerns.
The city said in a statement that the opening ceremony could go ahead, but only invited guests could attend, and that the general public would not be allowed near the the mosque.
In a statement published on Saturday on Facebook, DITIB expressed its disappointment over the city's decision, stating that it opposed the move and "could not comprehend" the reasoning behind it.
However, it also said DITIB would follow the city's instructions "in accordance with [its] respect for the law."
A large security perimeter had been set up around the mosque, and local police said the area remained quiet Saturday morning. Several thousand police officers had been deployed across the city.
DITIB's Facebook event for Erdoğan's visit showed up to 25,000 expected visitors, which had led local authorities to seek assurances about key safety concerns such as escape routes and access for paramedics.
A separate meeting with the premier of the state of North Rhine Westphalia, Armin Laschet, was also rescheduled to take place at Cologne/Bonn airport after a planned meeting at Wahn castle was scrubbed.
Germany, a country of over 81 million people, has the second-largest Muslim population in Western Europe after France.
Among the country's nearly 4.7 million Muslims, three million are of Turkish origin. Many of them are second or third-generations of Turkish families who migrated to Germany in the 1960s, and are well integrated in the country.