Europe's refugee crisis is revealing the changing soul of Germany.
Back in 2010, Chancellor Angela Merkel declared that multi-culturalism in Germany had been an abject failure; today the nation is opening its arms to hundreds of thousands of refugees, many of them Muslims from Syria, Iraq and Afghanistan.

The same year, politician Thilo Sarrazin published his book "Deutschland schafft sich ab" (Germany does away with itself), warning that Muslim immigrants were ruining German society. It shot to the top of the best-seller lists.
And yet in the past week crowds of Germans have greeted migrants arriving in the country with cheers, while volunteers are turning out in droves to help them.

"This is the moment where Germany has recognised it has a global role," says Harold James, an economic historian at Princeton University. "The country is changing very, very quickly."
The government expects 800,000 people to seek asylum in Germany this year, nearly twice as many as in any other year since reunification 25 years ago.

Merkel, known for her caution, has taken the high-risk step of opening Germany's doors wide, and implored her European Union partners to follow the example.
Encouraged by her, tens of thousands have arrived in the last week alone, many making the arduous and dangerous journey from the Middle East through Turkey, across the Aegean to Greece and then by land through the Balkans, Hungary and Austria.

She took the lead, her advisers say, to avoid an imminent humanitarian disaster, and German society seems ready to back her for the moment.
A poll earlier this month showed 33 percent of respondents wanted fewer refugees. But collectively they were well outnumbered by the 37 percent in favour of Germany continuing to take a similar number in the future and the 22 percent who believed their country should accept more.

For some, it is hard to reconcile Merkel's generous approach to the refugees with her hard line on bailing out Greece, where she has sometimes seemed to bow to public opinion and put German interests above all else.
Others view her refugee stance as a reversal, as perplexing as her decision in 2011 to phase out nuclear power after the Fukushima disaster, having previously backed atomic energy.

"A handful of years ago she declared the death of multi-culturalism. This looks to me to be in contradiction to that, an about-face," said Rita Chin, a historian and expert on German immigration at the University of Michigan.

A MATTER OF PROSPERITY

If Germany were not in such a strong economic position, Merkel would probably have thought twice about welcoming the refugees so openly. Public opinion might also have been less supportive were Germany experiencing the kind of problems that southern euro zone nations are suffering.

German unemployment is running at 6.4 percent, the lowest since reunification in 1990, and strong economic growth allowed the government to make a record 21 billion euro ($24 billion) budget surplus in the first half of the year.
"Generosity is a matter of prosperity, which France, Italy or Spain don't have," said Josef Joffe, publisher-editor of German weekly Die Zeit.

If the refugees can be successfully integrated, German society may also solve its problem of an ageing population and rock-bottom birth rate: a young and energetic population of new citizens could help to keep the economy on track.
Germany's welcoming approach has boosted its international image.

Painstakingly rebuilt since World War Two, this has been tarnished recently by the showdown over Greece, massive anti-Islam rallies in the former communist east at the start of the year and, more recently, violent anti-refugee protests there.

Some experts believe the country's own experience with refugees after the war, when over 12 million Germans were expelled from what is now eastern Europe, may influence the public mood more profoundly than any guilt tied to the Nazis.

Like the Syrians pouring into Germany now, many of those expellees resettled with next to no possessions, an experience that shapes attitudes now.
"It certainly has something to do with the past – family memories and the like, bombed-out grandparents and stories around the dinner table," said Fritz Stern, emeritus professor of history at Columbia University.

The post-war refugee experience and a desire to atone for Nazi crimes helped to shape West Germany's Basic Law, or constitution, written when the country was divided. This guarantees victims of political persecution the right of asylum. But in practice, integrating newcomers has not always been smooth.

In the decades after the war, West Germany encouraged immigration as a way of tackling labour shortages, but described those who came from countries such as Turkey, Italy and Greece as "Gastarbeiter", or guest workers, as if to reassure the population that they would return home once the work was done.

The generous asylum laws encountered their first real challenge in the 1990s when hundreds of thousands fled north to escape war as Yugoslavia disintegrated.
Back then, the German economy was struggling with the after-effects of reunification. In the east, refugees became targets of the far-right.

In response, German politicians pushed for a tightening of asylum guidelines. This led to the EU writing the "Dublin" rules, which oblige migrants to seek asylum in the first member state they enter. The assumption was that this would shield Germany, a country where citizenship had long been viewed through the prism of bloodline and culture.

TWO-FOLD CHALLENGE

That myth has been shattered over the past weeks. Refugees have refused to stay in often squalid, chaotic conditions in EU states such as Greece or Hungary, determined get to Germany or Sweden where the welcome would be warmer.
This forced Merkel, as Europe's most powerful leader, to act before a humanitarian disaster unfolded on the EU's rim.

"This is a major challenge, but what was the alternative?" said a Merkel aide, declining to be named. "Do you wait until people are dying, until you have horrible scenes on the highways in Hungary before you act? Do you close the border between Austria and Germany? There was no other option."

Now, Merkel must manage integration domestically, and persuade other EU countries to share the burden despite resistance and resentment, bordering on fury in some capitals, at her stance.
"It's acting as a huge magnet and affecting everybody else," historian Brendan Simms said of Germany.
Merkel has urged Germans to show flexibility, patience and openness.

There is reason to hope they will as the country's face changes.
Germany won the 1990 football World Cup with an all-white team. The squad that won in 2014 included Jerome Boateng, son of a Ghanaian immigrant, Sami Khedira, whose father is Tunisian, and Mesut Ozil, grandson of a Gastarbeiter.

"I think Germans, once taught to be the 'master race', are moving towards the American model - citizenship by an act of will," said Joffe. "In my lifetime, they have become a lot more accepting of different colour, religion and ethnicity."
Some worry that this openness, built on a generation that grew up after the fall of the Berlin Wall, is fragile.

If the economy dips, if the country struggles to integrate the new arrivals, or if Germans conclude Merkel's government cannot manage the influx, then the progress could evaporate.
"The truth is that it wouldn't take much to shift the discourse," says Chin of the University of Michigan.
On the margins, it may already be shifting.

Hans-Peter Friedrich, a former interior minister and member of the Christian Social Union (CSU), the Bavarian sister party to Merkel's conservatives, said last week that Germany had already lost control of the refugee tide. One of his colleagues, Markus Soeder, has called for changes to the constitution so that asylum rules to be tightened.

A survey last week by the Emnid polling group for private broadcaster N24 showed two in three Germans believe Berlin is doing a "rather bad" or "very bad" job of handling the crisis.
People close to Merkel say the government's ability to house the refugees as winter sets in, to get them learning German and contributing to the economy, will be crucial.

"We could look back at this as a historic shift for Germany, but that depends on it succeeding," the aide said. "We know the mood can turn very fast."