It was "the decision of her life," weekly Die Zeit judged recently, ahead of a vote on Friday that will crown a new head of the centre-right Christian Democratic Union (CDU) party Merkel has led since 2000.
Welcoming refugees may have ushered in Merkel's final act
Opening Germany's doors to more than a million refugees may come to define Chancellor Angela Merkel's legacy, a landmark moment in her career that sparked a backlash which could hasten her political exit.
Late summer 2015 saw hundreds of thousands of refugees attempt to reach Europe in often appalling conditions -- prompting Merkel to welcome those who found themselves stuck in Hungary.
After completing the journey to the Austrian-German border by coach or train or even on foot, many were welcomed by Germans with bouquets of flowers, food and other supplies.
Syrians and Iraqis fleeing conflict in the Middle East dubbed the chancellor "Mama Merkel", the compassionate European who had offered them shelter -- often in requisitioned gym halls or disused barracks.
The nickname is "just a joke, it oversimplifies things," says Rami Rihawi, a 22-year-old Syrian from Aleppo who arrived in Berlin in late 2015, spending seven months living with 300 other people in a gym.
"But she will go down in history" for the choices she made back then, he predicted.
Rihawi met Merkel in 2017 when she visited a training centre for young computer programmers where he was studying, before he was hired as a software developer at a start-up.
'We can do it!'
"We can do it!" -- the phrase Merkel repeatedly used back then to reassure her fellow citizens they were up to the mammoth integration challenge -- has since disappeared from her lexicon, after becoming a weapon flung at her by political opponents.
Germans' initial enthusiasm and openness quickly gave way to doubt over the mass arrivals, especially in eastern states already aggrieved by their economic disadvantages compared to the wealthier west.
At routine events or on the campaign trail, Merkel was met with masses of people whistling and heckling.
"Resign!" a crowd in Dresden chanted on Germany Unity Day in 2016.
The CDU's traditional Bavarian allies -- the more conservative CSU -- have insisted on annual quotas for the number of migrants allowed into the country.
Merkel long resisted such calls before finally giving in, in all but name.
Parliamentarians quickly passed tougher asylum laws that contributed to a sharp reduction in the number of new requests, from a peak of 750,000 in 2016 to 158,000 between January and October this year.
And endless calls to be tougher about deporting rejected asylum seekers have seen charter flights take Afghans back to Kabul.
Some politicians have even urged that people should be returned to parts of Syria.
'Not just Merkel'
With migration dominating the airwaves, the far-right Alternative for Germany (AfD) party began notching up electoral wins after years of stagnation.
It has become the strongest party in certain regions, winning 92 seats in the Bundestag (lower house) 2017 parliamentary election, promising to "hunt" Merkel.
Such a major presence for the far-right in parliament has not been seen in Germany since 1945, as the country's strong memory of the Nazi past restricted xenophobia's appeal.
Meanwhile the CDU's record low in 2017 prompted the party's conservative wing, which had always bridled at Merkel's centrist leadership, to turn up the volume on its complaints.
It took six months for the chancellor to form her fourth government, and the shaky alliance has been riven by repeated clashes over migration -- fed by the disunity in the conservative camp.
After a string of setbacks in regional elections, Merkel announced in October that she would not stand for reelection as party chief this month -- nor for reelection as chancellor in 2021.
"Maybe it's a good thing that she's leaving, so that a new generation can emerge," said Syrian refugee Rihawi.
In any case, "it wasn't just her, but the Germans who opened their doors to us," he added.
Opinion polls give some support for that view, with the ecologist, pro-refugee Greens party currently flying high above both the AfD and the CDU's traditional foes, the Social Democrats.
JOIN OUR PULSE COMMUNITY!
Eyewitness? Submit your stories now via social or: