THIS September, at the height of what the German press has since dubbed an “autumn fairy-tale”, Angela Merkel visited an asylum centre in Spandau, near Berlin. The refugees greeted the German chancellor as though she were their saviour, pressing close for selfies with her. Mrs Merkel does not usually take kindly to unsolicited male hugs. But this time she posed gamely and flashed winning smiles.

What made her a heroine to the refugees was a decision she had taken only days earlier. Thousands of people trudging through the Balkans toward northern Europe were stranded in Hungary in precarious conditions. Empathising with these huddled masses, Mrs Merkel temporarily ignored the European Union’s asylum agreements, which stipulate that the member state in which refugees first arrive must process their asylum requests. On the chancellor’s command, Germany opened its borders to the refugees. Coming via Austria on foot, bus and train, more than 20,000 arrived in the first weekend of September alone.

At first, many ordinary Germans greeted them in a euphoric mood—from the railway station in Munich where the refugees disembarked by the wagonload to asylum centres around the country like the one in Spandau. But others in Germany and across Europe were taken aback. There has since been a marked backlash against the August Willkommenskultur whose spirit Mrs Merkel captured and encouraged, with those Spandau selfies held up as reckless enticements for yet more Syrians and others to join the 1m refugees now expected in Germany this year.

Mrs Merkel at first seemed surprised by the sudden turn in public opinion. “Do you really think that hundreds of thousands leave their home and embark on this difficult journey only because of a selfie with the chancellor?” she asked Anne Will, a television talk-show host, on October 7th. Since then, however, Mrs Merkel has turned defiant and bold, as though inspired by a clear moral purpose.

Having been governed by her for ten years—she first took office on November 22nd 2005—Germans thought they knew Mrs Merkel. Whereas her predecessor, Gerhard Schröder, was dubbed the “basta chancellor” for his brash assertiveness, Mrs Merkel was valued, if often also criticised, for her caution. Her governing was a “politics of small steps”, lampooned for endless hedging and “leading from behind”. As recently as this summer, the jury that chooses Germany’s “youth word of the year” from a list of zeitgeisty neologisms was expected to plump for merkeln (“to merkel”), meaning to delay and obfuscate so as to avoid big decisions.

To widespread surprise and some unease, though, the merkelling chancellor has been transformed. She has found a new voice that is simple and strong. “If we start having to apologise for showing a friendly face in emergencies,” she says, “then this is not my country.”

Cometh the hour

The change in style reflects the nature of the new challenge. A lot of Mrs Merkel’s decade in power has been taken up with the international demands of what might be called crisis management, had the problems involved not become chronic: the financial troubles in the euro zone, especially Greece; the confrontation between Vladimir Putin and the West; the spectre of a British exit from the EU. Preoccupied with these international worries, she stuck to small-bore fiddling at home, and the Germans forgave her. The dramatic acceleration of the refugee crisis, though, merges international and domestic demands into one daunting task.

The past challenges have all served, one way or another, to enhance Mrs Merkel’s stature as Europe’s pre-eminent leader. The euro zone’s response to Greece always hinged mainly on her stance, even if she failed to act boldly enough. In the Ukraine confrontation, she reacted faster and more vigorously; while she brought François Hollande, the president of France, along to summits in Minsk with Vladimir Putin, the president of Russia, and his Ukrainian counterpart, it was she who talked Mr Putin down from even worse escalation (at least so far). And it is Mrs Merkel who matters most to Britain’s prime minister, David Cameron, in his effort to win the concessions he thinks needed to keep Britain in the EU (see article).

There are four main reasons for Mrs Merkel’s central role. First, she governs at a time when other European leaders seem weak or even absent and America’s interest in solving European problems is on the wane. Second, she has no credible challenger within Germany, either in her own party or in others. Third, Germany is the biggest and strongest economy in the EU; it has a budget surplus and an unemployment rate (6%) last seen before reunification. Fourth, Mrs Merkel has proven herself adept at crisis diplomacy. At home or abroad, she has a knack for dealing with complicated, vain or macho men, from Mr Putin to Turkey’s Recep Tayyip Erdogan.

Mr Orban and Mr Seehofer: double trouble Now two more of Europe’s many difficult men threaten to undermine her stature. One is Viktor Orban, the illiberal Hungarian prime minister whose answer to the refugees has been barbed-wire fences. Speaking for several eastern members of the EU he has called Mrs Merkel’s welcome of the refugees “moral imperialism”. That a nationalist demagogue should cause trouble is hardly a shock. More surprising are the attacks by Horst Seehofer, who is the premier of Bavaria, the state through which most refugees enter Germany, and also the boss of the Christian Social Union (CSU), the regional sister party to Mrs Merkel’s national party, the Christian Democratic Union (CDU). These two Union parties, as they are called, sit as one group in the Bundestag and are usually reliable conservative allies. There is a long CSU tradition of sniping against the federal government to assert the interests of Bavaria. But CSU leaders usually stop short of damaging CDU chancellors.

This time is different. In September Mr Seehofer called Mrs Merkel’s embrace of the refugees a big mistake. He then invited Mr Orban to a CSU gathering as guest speaker and smiled smugly as the Hungarian railed against the chancellor. He constantly demands that Mrs Merkel restore the “rule of law”, implying that she has broken it. And he insists that she put a stop to the refugee flows, even though she has repeatedly said that the constitution foresees “no upper limit” to the human right for asylum—and even though he can offer no explanation of how a stop would work. In October he warned ominously about “an existential crisis for the CDU-CSU.”

If not her, who?

His rebellion has spread in attenuated form to Mrs Merkel’s own party. In October 34 regional CDU politicians complained in an open letter that her “policy of open borders accords with neither European and German law nor with the programme of the CDU”. In meetings of the parliamentary party some members have openly attacked Mrs Merkel.

The internal whingeing, unusual in a party that sets much store by unity behind its leader, coincides with a deteriorating tone in public debate. At an anti-Muslim rally in Dresden in October, a man held up a drawing of a gallows with the caption “reserved for Angela Merkel”. In Thuringia Björn Höcke, a politician of the Alternative for Germany, a xenophobic right-wing party, led a chorus of demonstrators chanting that “Merkel must go”.

Polls confirm a turn in public opinion. Support for the Union parties has dropped seven percentage points since the summer and is now at its lowest point since 2012. Three other politicians in her coalition now enjoy higher ratings in opinion polls than Mrs Merkel, long Germany’s most popular politician. Yet this slide should not be exaggerated. None of those more popular than Mrs Merkel will ever be a candidate for her job. Among members of the CDU only one in three takes Mr Seehofer’s side on what to do about refugees, while 57% stand with the chancellor.

Her personal support is even higher than support for her position. One poll in October found that 82% of Christian Democrats approve of Mrs Merkel’s leadership and 81% want her to run for chancellor for a fourth time at the election due in 2017. Sigmar Gabriel, leader of the Social Democrats, Germany’s second largest party and the Union parties’ coalition partner, can but dream of such numbers. Though he is likely to be Mrs Merkel’s challenger in two years’ time, only 40% of his party approves of him.

Support in the CDU might not matter if the public was turning wholeheartedly against the chancellor. So far it hasn’t: averaging the most recent opinion polls shows the Union parties with 37.5% of the electorate, the SPD with 25%. The backlash, while real, is confined to a minority. A poll of seven European countries by IFOP, an institute in Paris, shows that German support for the idea that sheltering refugees from war and persecution is right in principle is dropping. But it is still high both in absolute terms and in comparison to attitudes in other countries. In September 79% of Germans agreed with the proposition; in October 75% did. Less than half the British, Dutch or French feel the same way. The differences are starkest among conservatives: 72% of Union supporters in Germany favour the principle of asylum; only 29% of Republicans in France do so. Part of the difference stems from German optimism about the economy and some of it from a sense of Germany’s special responsibility given its past. The effect of Mrs Merkel’s leadership probably plays a role, too.

Far from being the beginning of the end for the chancellor, this crisis seems to be reinvigorating her. Mrs Merkel has never commented on how long she intends to stay in power, but for years a few contrarians have surmised that she has been planning to step down after a decade, or perhaps when her third term ends in 2017. By doing so, they argue, she would avoid the fate of her only two longer-serving predecessors, Konrad Adenauer (1949-1963) and Helmut Kohl (1982-1998), both of whom overstayed their effectiveness and their welcome.

How do Angela Merkel's 10 years in office compare to other European heads of state? Mrs Merkel, however, gives every impression of being focused not on a graceful exit but on rising to her biggest challenge. A quantum chemist by background, she takes a scientific approach to intellectual conundrums, cutting them into their component parts. She enjoys the challenge of doing so even—perhaps especially—when the problem is as large and complex as the latest crisis. If she has eyes on some high international office it can surely wait; she is only 61. When she failed to win the Nobel peace prize last month, after being rumoured to be the favourite, she appeared more relieved than disappointed; she has no yen for global recognition that might, as was the case with Barack Obama, make things harder domestically. Moreover, she is all but assured of a fourth term. At present the parties to the left of the CDU—the Social Democrats, the Green party and The Left—have a narrow majority in parliament; they do not make up the government because The Left, descended from East Germany’s communist party, remains a pariah. An anti-refugee shift in 2017 would probably deprive the left of this notional majority and bring in the Alternative for Germany on the right, leaving Mrs Merkel in the middle and, barring an unprecedented CDU collapse, the leader of the largest party. She would thus be free to set about forming a centrist coalition (she has ruled out ever governing with the Alternative).

Black and green all over

The Greens may be her likeliest partners. They are hungry for power, and a CDU-Green state government in Hesse that some regard as a warm-up for a national deal is working well. That such a deal is possible reflects the fact that in her 15 years as leader of the Christian Democrats Mrs Merkel has nudged her party leftward to squat on centre ground. Where once the CDU stood for patriarchy and the traditional family, it now accepts civil unions for gays and lesbians, boardroom quotas for women and a legal right to crèches so that mothers can work.

And, in an about-face after the disaster at Fukushima in 2011, Mrs Merkel ended the CDU’s long support for nuclear energy with a decision to turn off Germany’s nuclear plants by 2022. There were many who saw in that U-turn a telltale “Merkevellian” streak. German public opinion already favoured phasing out nuclear power. Mrs Merkel, while appearing spontaneous, neatly brought her party into line with an emerging consensus and neutered the Greens’ main campaign issue. The CDU and the Greens are now on the same side in trying to transform Germany into a nation powered by renewables.

Combining such guile with unideological pragmatism has served Mrs Merkel well in her “grand coalitions” with the Social Democrats. To keep things stable, Mrs Merkel has conceded some policies that she is thought to consider dim-witted. For example, the pension age for some workers was lowered from 65 to 63, which is insane given the ageing population. But Mrs Merkel calculated that costs of the insanity were manageable and the political capital that would have been required to stymie it was needed for bigger problems.

By that logic the refugee crisis, which Mrs Merkel has described as greater than that of the euro zone, and on a par with the turmoil of reunification in 1990, will have her reaching deep into her reserves. She stands ready to do so. It is one of the few policy areas where this daughter of a Protestant pastor thinks in terms of non-negotiable principles. Others include the security of Israel, which she called part of Germany’s raison d’état in an address to the Knesset in 2008, European harmony and the transatlantic alliance. She viscerally opposes Mr Putin’s transgression across internationally agreed borders in Ukraine. And now she sees succour for people fleeing war as a categorical imperative.

Mrs Merkel understands the pressure this puts on Germany. Municipal governments are overwhelmed by the challenges of finding accommodation. Schools are straining to integrate refugee children who speak no German. And there are legitimate questions about whether Germany can culturally integrate so many Muslims into a society that values sexual equality and free speech. There is a great deal on which to spend carefully nurtured political capital (not to mention cash).

In managing all this here is room for some judicious walking back from the heady days of September. Hurried legislation this autumn has tightened some rules. All Balkan countries are now considered “safe”, which makes it easier to reject and deport asylum applicants from that region. Cash allowances to refugees are being replaced by vouchers, in the hope that this will reduce incentives for economic migrants. On November 1st she also did her best to freeze the conflict with Mr Seehofer, hashing out six pages of joint positions that he can trumpet as a victory to his supporters in Bavaria. Many of them, such as joint border patrols with Austria, have little more than symbolic value.

At the European level, Mrs Merkel’s task is trickier. For a long time she opposed the relocation of asylum-seekers between EU states. Only since September, when Germany itself became the centre of the crisis, did Mrs Merkel begin pushing for large-scale and formal solidarity. So far the EU has agreed to share only 160,000 asylum-seekers, a comparatively modest number. Her demands for more solidarity have run into hard walls, especially with the eastern countries.

Merkelling no more

The roles defined by the euro crisis have thus reversed; Germany needs help and is finding other member states to be recalcitrant. Mrs Merkel needs to play the supplicant. But in reality, she remains Europe’s indispensable leader. Among other things, she has the most clout to help reimpose order on the EU’s frontier with Turkey. Already she has softened her opposition to eventual Turkish membership in the EU and her criticism of Mr Erdogan’s encroachments on free speech. She hopes that Turkey’s election on November 1st, in which Mr Erdogan’s party won an absolute majority, will allow him to press forward with a deal whereby the EU gives Turkey lots of money, and perhaps visa-free travel, while Turkey agrees to hold the 2m refugees already there.

The ultimate causes of the refugee crisis are neither Mrs Merkel’s fault nor in her control. She cannot end the civil wars and proxy conflicts in the Middle East. Bernd Ulrich, a German pundit, puts it nicely: Mrs Merkel “did not make history in early September, the refugees did. She only acknowledged history.” But her legacy will be determined by whether she can hold together Germany and the EU as they absorb this shock. For a woman who spent half her life behind the intra-German wall, a Europe of fences and barbed wire would be a failure. Keeping Germany open and tolerant inside an EU true to its humanitarian founding values is not her policy. It is her mission.