Turkey's President Recep Tayyip Erdoğan and German Chancellor Angela Merkel at the G20 meeting in Hamburg | Tobias Schwarz/AFP via Getty Images Angela Merkel’s Turkish roulette Berlin’s patience with Recep Tayyip Erdoğan has run out.

BERLIN — After years of enduring insults, provocations and outright hostility from Turkey’s Recep Tayyip Erdoğan, Angela Merkel is fighting back.

Turkey’s arrest this month of a German human rights campaigner on a terror-related charge triggered what Berlin described this week as a “new orientation” of its position toward its longtime ally. The activist, Peter Steudtner, is one of nine Germans, including journalists and civil society campaigners, now in custody in Turkey on what Berlin considers dubious grounds.

Foreign Minister Sigmar Gabriel’s announcement of retaliation Thursday, though wrapped in measured diplospeak, was nothing short of an ultimatum.

“We’ve been very patient, even if it wasn’t that easy,” Gabriel said explaining the measures. “We have no choice.”

Berlin’s message to the Turkish president: Reverse course now or suffer the consequences.

“This time they’re pretty deadly serious,” said Jan Techau, director of the Richard C. Holbrooke Forum at the American Academy in Berlin. “The Turks are playing this like a rogue state."

Erdoğan arrests German tourists?

Both the travel advisory and the investment warning issued by the German foreign ministry on Thursday are aimed squarely at Turkey’s Achilles' heel — its economy.

Though the government succeeded in stablizing the economy with fiscal stimulus in the wake of recent political turmoil, Turkey’s recovery remains fragile and unemployment high.

Further shocks — be they from a drop in tourism or a decrease in foreign investment — would hit the country hard.

While Berlin stopped short of warning citizens not to travel to Turkey altogether, this week’s travel advisory is nonetheless likely to have a chilling effect on a sector that accounts for nearly 15 percent of the Turkish economy.

Germany’s most-watched evening news program led with the news on Thursday. “Is Erdoğan now going to arrest vacationers?” asked a front-page headline in the mass-circulation Bild.

Germans comprise the largest group of tourists visiting Turkey, with more than 5.5 million traveling there in 2015 alone.

Even more damaging to Turkey, however, would be a slowdown in German investment. Gabriel said Berlin was evaluating whether to continue to support German companies active in Turkey with export guarantees and other assistance, due to “the absence of the rule of law.” He said the government couldn’t recommend anyone invest in a country where individuals and companies are arbitrarily accused of supporting terrorism.

Nearly 7,000 German companies operate in Turkey and count among the country’s largest investors. A further deterioration in ties would likely also hit Turkish exports to Germany, the country’s largest single export market.

Erdoğan appears to have heard if not gotten the message.

On Friday he called Gabriel’s criticism “evil propaganda,” denying the suggestion that Turkey was targeting German companies. Economy Minister Nihat Zeybekci said the government guaranteed the protection of German investments “100 percent.”

Still, Erdoğan showed no sign of tempering his rhetoric, insisting he wouldn’t be cowed by Berlin.

Refugee concerns

Merkel’s relationship with Erdoğan has been fraught ever since she declared her opposition to Turkish EU accession during her 2005 campaign for chancellor. Though she succeeded in winning his support for the EU’s so-called refugee deal with Turkey in 2016, relations between the two leaders have remained strained.

Merkel is far from alone in her skepticism about the Turkish leader. Erdoğan's authoritarian course drew intense criticism in Germany even before last year’s attempted coup, which led to the arrest of tens of thousands of Turks and the suspension of due process. Erdoğan’s decision last year to pursue a lawsuit against a German comedian who parodied him on television cemented his reputation many Germans’ minds as a megalomaniac dictator.

He stirred even more outrage in Germany earlier this year by comparing German officials to Nazis for not allowing his surrogates to campaign for a controversial constitutional referendum designed to grant him sweeping powers. Germany is home to more than 3 million Turks, many of them strong Erdoğan supporters.

Through it all, Merkel remained largely stoic. While she rejected Erdogan’s Nazi insults, her strategy was focused de-escalation. Berlin was confident it could repair the relationship through diplomacy.

Merkel worried a more confrontational approach would antagonize Germany’s large Turkish population.

An even bigger concern: The refugee deal, which has been a key factor in reducing the flow of Syrians and others into Europe.

Despite Berlin’s diplomatic efforts, relations with Turkey have only gotten worse.

A series of events over the past several months have steered the relationship toward a cliff.

It began with Ankara’s refusal to allow German MP’s to visit German troops stationed at Turkey's Incirlik airbase as part of the anti-ISIS coalition. After failing to resolve the dispute despite months of behind-the-scenes cajoling, Germany decided in June to pull out its troops and move them to Jordan.

What has been most damaging to the bilateral relationship, however, was the arrest of German journalist Deniz Yücel. Yücel, a German-Turkish national who writes for the daily Die Welt (published by Germany’s Axel Springer, POLITICO Europe’s co-owner), was taken into custody in February and accused of supporting terrorism. Yücel, who is being held in solitary confinement, had written articles critical of Erdoğan and his family.

Merkel has tried for months to win his release to no avail. Turkey’s decision to arrest Steudtner, the human rights activist, on July 5 left Berlin with no option but to respond forcefully, government advisers say.

Suggestions that Berlin's policy shift is driven by the general election campaign now underway are wide of the mark, they say. The decisions have been closely coordinated between Merkel’s conservatives and the Social Democrats. That said, taking a tough stand on Turkey plays well with many German voters and Gabriel has been careful to include Martin Schulz, his party's chancellor candidate, in his deliberations.

'Two to tango'

The chancellor herself has stayed in the background, letting Gabriel, the former SPD leader, take center stage.

Her silence could make it easier for Erdoğan to change course. Berlin left him an opening by saying only that it was “exploring” further measures, such as suspending financial assistance to companies.

If Erdoğan hopes to preserve Turkey’s economic health he would be wise to back down. Once the German money stops flowing, European funds are also likely to run dry. Berlin is expected to push the EU to halt nearly 5 billion euros in aid to Ankara in connection with its accession bid.

The Turkish leader could try to retaliate by pulling out of the refugee deal. But that could backfire. The EU has granted Turkey billions in assistance to take care of the refugees, money it sorely needs to deal with the crisis.

He could also lose support domestically by trying to use the refugees as leverage.

In Berlin, officials remained hopeful, if not optimistic, that the dispute could be resolved without further escalation.

“It’s takes two to tango,” Gabriel said.