"The lady's not for turning." For those with long political memories, this sentence in 1980 cemented the image of British prime minister Margaret Thatcher.

Thatcher, never one to shy from embossing her reputation, uttered the famous words herself. She soon became known as the Iron Lady.

Angela Merkel doesn't polish her credentials so publicly, but she's just as steely. Recently she's needed to be.

It's been a dreadful time for the German chancellor. Her Christian Democrat party (CDU) came third — third — in state elections in Mecklenburg-Western Pomerania on Sept. 4. That's her home turf; her own riding is there.

The party that beat hers into third place is the Alternative for Germany (AfD). It ran on just one plank: enough of refugees.

To many in Germany, that also means enough of Merkel. It was she who, one year ago, opened Germany's doors to more than a million refugees.

I was in Budapest in September 2015 when thousands of angry Syrian and Iraqi refugees, blocked and penned up for days by the Hungarian government, began a long march of 120 kilometres to the Austrian border, determined to break through if necessary.

German Olympian Fabian Hambuechen displays his high-bar gold medal to Chancellor Angela Merkel on Tuesday. Two days earlier, the voters of Mecklenburg-Western Pomerania were much less kind to her. (Reuters) Late-night phone calls from Merkel convinced the Hungarian and Austrian leaders to let them through.

Crowds in Munich applauded as refugees arrived on trains from the Austrian border. But I remember a German cameraman, himself a Bavarian from Munich, muttering over and over, "The Germans aren't going to like this."

He seems to have been right. In Bavaria itself, the CSU party, the junior partner in a decades-long alliance with Merkel's CDU, has been sniping publicly at Merkel, particularly in the wake of the recent election disaster.

"Our union (of the parties) is severely threatened," the CSU Bavarian premier said. "It's a wake-up call; this is very harmful," trumpeted one of his lieutenants. They made it clear they believe it's Merkel who's asleep at the wheel, and that the country needs a new tough policy on refugees and migrants.

But the lady's not for turning, as she made clear in the Bundestag, the German parliament, two days after the electoral debacle.

'Slogans and simple answers'

"The AfD is a challenge for all of us in this house," she said, declaring her policy on refugees wouldn't change.

"If we seek to get the better of each other for short-term gain … the ones who'll win are those who depend on slogans and simple answers," she said. "I am quite certain if we bite our tongues and stick to the truth then we'll win back the most important thing that we need, the trust of the people."

Winning back that trust may not be easy. Consider the experience of the people of Doberlug-Kirchhain, a town of 8,700 in eastern Germany.

German Family Minister Manuela Schwesig helps children climb through a window at a refugee shelter in Berlin on June 21. Germany has absorbed the mass influx of refugees in the last year relatively smoothly, although the sudden arrival of hundreds of thousands of Muslims and the money spent to accommodate them has left Germans unsettled and frequently furious. (Reuters) Just down the road was an abandoned military base. Last year, as the refugees poured into the country, someone in the national government remembered the abandoned base. They could house hundreds of refugees there.

And so they did, first transforming the barracks into living quarters for families, with playgrounds and playing fields. They also repaired the road into town with new traffic lights and laid on a shuttle bus for refugees so they could go to buy groceries.

Very generous, but badly received by the local population which had just lost their bus service because of state cutbacks. Different budget envelopes, as the accountants say.

Things weren't improved when the first question many refugees asked was, "Where's the train station?" They wanted to live in cities like Berlin or Frankfurt.

'Send the bill to Merkel'

The mood soured even more when some refugees, having stocked up on groceries in the local supermarket, told the cashier, "Send the bill to Merkel." And then walked out.

The police, anxious to avoid trouble, told the supermarket to swallow the loss if it was less than $75.

A year later the family quarters are almost all unused, the playgrounds empty. The more than 700 refugees who first arrived have dwindled to 125, almost all young men without families. And they want to leave, too.

Not surprisingly, the town is very receptive to the anti-migrant message of AfD. The mood, one person said, is: Merkel deserved the kicking she got in the state vote.

Emergency shelters stand empty

At a national level, it should be said, the mass influx has been absorbed relatively smoothly. Almost all the new arrivals have found regular housing. Hundreds of emergency shelters now stand empty.

Tens of thousands of refugees are in German-language courses. The problem is to find enough teachers. And because of language difficulties, unemployment among officially recognized refugees is still very high. But they receive generous social benefits.

Syrian refugees learn to reconstruct houses at a military education centre in Ingolstadt, Germany on Sept. 1. Germany is training refugees in the hope that they will eventually be able to help rebuild their homeland. (Associated Press) And despite fears, particularly in the wake of the Cologne New Year's Eve sexual attacks on women, the overall crime rate has not jumped. In fact, the main spike is caused by attacks on refugees themselves.

But statistics do not calm fears. The sudden arrival of hundreds of thousands of Muslims and the money spent to accommodate them has left Germans unsettled and frequently furious.

Mecklenburg-Western Pomerania is one of the country's smaller states by population (the Germans call them Laender and there are 16 of them) but the AfD won almost 21 per cent of the vote. A minor political earthquake.

For decades German elections have been dull affairs, earnest discussions of taxes, wages and health care. In this atmosphere Merkel was the perfect leader.

Political experts note and mainstream politicians fear that the Mecklenburg vote may herald a new era.

"The AfD cleverly used the refugee theme to 'emotionalize' the debate," said Christian Nestler, a political scientist at the University of Rostock.

The Austrian spectre

Emotion! Refugees. The combination terrifies many German politicians who see the Austrian spectre looming. There a far-right candidate used the same combination to dislodge the country's main parties and almost win the presidency in May. The result was so close there'll be a rerun election in October.

Merkel says she'll fight, and fight hard, to persuade Germans that the refugees will help, not harm their country.

But she hasn't much time. She must decide at the turn of the year whether she'll run again for a fourth term as chancellor. The national elections are next September. And her poll numbers are drooping.

The lady will not turn, but will she run?