German Chancellor Angela Merkel on Monday defended her government's handling of the refugee crisis, but said the poor election result showed there was work to be done to win back voter confidence.

"I am very unsatisfied with the outcome of the election," Merkel told reporters on the sidelines of the G-20 summit in China. "Obviously it has something to do with the refugee question. But I nevertheless believe the decisions made were right and we have to continue to work on them."

Merkel's conservative Christian Democratic Union (CDU) was relegated to third place behind the right-wing, anti-immigrant Alternative for Germany (AfD) party in weekend polls in Mecklenburg-Western Pomerania. The CDU garnered 19 percent of the vote - its worst ever score in the ex-communist state, which is also where Merkel has her parliamentary constituency.

The AfD managed to draw supporters from across the spectrum to finish in second place with 20.8 percent of the vote. The CDU's coalition partner, the Social Democrats (SPD), remained the strongest party with 30.6 percent, but it too lost part of its voter base to the AfD.

Watch video 01:47 Chancellor Merkel on election setback

'Work to be done'

Merkel told reporters that, as chancellor and CDU party chief, "of course I am also responsible," but she insisted that opening Germany's borders to more than 1 million asylum seekers in 2015 was the right thing to do.

She added that the numbers of refugees entering the country had since declined, and that the government was working to integrate the migrants already in Germany. "There is much to be done to win back trust, and the topic of integration will play a huge role, as well the repatriation of those who don't gain residency rights," Merkel said.

The right-wing AfD has enjoyed a surge in support among voters concerned about the influx of migrants to Europe over the past year. Despite being only three years old, the party is already represented in nine out of Germany's 16 regional parliaments.

Leif-Erik Holm, who heads the AfD in Mecklenburg-Western Pomerania said the election result should act as a warning to the government to rethink its refugee policies and that "today could mark the beginning of the end of the chancellery of Angela Merkel."

The Sunday poll was the first of five regional votes before a national election due to take place next September.

nm/rc (AP, dpa, Reuters, AFP)