GOSLAR, Germany (Reuters) - Germany and Turkey’s foreign ministers on Saturday agreed to pull out all the stops to improve ties that have soured due to disputes over Ankara’s post-coup crackdown and the arrests of German citizens in Turkey, but they stressed differences remain.

Meeting in an ornate imperial palace in central Germany, the pair said they were keen to make amends after falling out as Ankara rounded up suspected supporters of a failed 2016 coup, a comedian mocked Turkey’s president and a German-Turkish journalist was detained without charge.

German Foreign Minister Sigmar Gabriel pointed to historic links between the countries including the role Turkish guest workers played in rebuilding Germany after World War Two, Turkey’s hospitality in taking in German refugees during the Nazi era and the 3 million-strong Turkish community here.

“We’ve both made it our business to do everything we can to overcome the difficulties there have been in German-Turkish relations and to find more common ground in the future by remembering everything that binds us together,” Gabriel said.

German politicians have been outspoken critics of Turkey’s post-coup crackdown, in which some 50,000 people have been arrested pending trial and 150,000, including teachers, judges and soldiers, have been sacked or suspended from their jobs.

Turkey says the crackdown, targeting alleged supporters of a Muslim network it blames for the coup, is necessary on security grounds. Ankara has criticized Germany’s refusal to hand over asylum seekers it says were involved in the failed putsch.

Adding to the tension, the German government believes seven Germans, of whom four have dual citizenship, are being held in prison in Turkey for political reasons.

German Foreign Minister Sigmar Gabriel and his Turkish counterpart Mevlut Cavusoglu attend a news conference in Goslar, Germany, January 6, 2018. REUTERS/Ralph Orlowski

But in a sign of recovering relations, Turkish Foreign Minister Mevlut Cavusoglu said the NATO allies believed they could overcome recent escalations in tension through dialogue.

Cavusoglu said Turkey and Germany shared similar views on conflict-hit Middle East countries and they were cooperating on humanitarian issues like migration.

During a working lunch on Saturday, he and Gabriel would discuss steps they can take together in future, Cavusoglu said.

THORNY ISSUES

But the pair acknowledged areas of disagreement. Cavusoglu said one bone of contention was whether Turkey should be allowed to join the European Union - a move that Germany opposes - but he sounded a conciliatory note.

“There is benefit in pushing our disagreements aside and continuing on our path. We should focus on issues that serve as win-win for our countries, like the Customs Union,” he said.

One of the disputes between Berlin and Ankara centers around the arrest of Deniz Yucel, a reporter for German newspaper Die Welt. Turkish authorities accuse him of spreading propaganda for the outlawed Kurdistan Workers Party (PKK). He denies the charge.

Gabriel said he had discussed thorny issues including Yucel’s case with Cavusoglu but did not give details.

Germany is Turkey’s biggest trade partner but exports from Europe’s largest economy to Turkey dropped by 5.9 percent year-on-year in the first nine months of 2017.

Gabriel told magazine Der Spiegel on Friday Germany had refused to authorize “a large number of arms exports” to Turkey and that would remain the case until Yucel’s case was resolved.

But on Saturday he said the German government would consider whether to deliver mine protection gear for armored vehicles in Turkey, an issue not linked to arrests, he said.