German Chancellor Angela Merkel admitted on Monday that mistakes had been made in the refugee crisis after her conservative Christian Democrats (CDU) suffered heavy losses in a string of state polls.
"We have in recent years not done everything right," Merkel told a press conference following a fresh election debacle for the CDU in Sunday's Berlin city state. "We waited too long before we really become engaged in the refugee issue."
Merkel's decision a year ago to open Germany's borders to allow in refugees stranded in Hungary has triggered a slump in the CDU's support, deep divisions among her allies and a surge in the vote for the right-wing populist Alternative for Germany (AfD).
"If I could, I would take the time to rewind many years so as to better prepare myself and the government and all those in responsible positions for the situation in late summer 2015 which took us rather by surprise," said Merkel.
About 1 million refugees - many fleeing wars in Africa and the Middle East - entered Germany last year after the borders were opened.
"In the balance it was absolutely right," to provide refuge for the waves of migrants, Merkel said.
"But it ultimately meant that for a time we did not have sufficient controls," the chancellor and CDU chief said.
Founded just three years ago, the AfD has now gained a foothold in 10 of Germany's 16 states after securing 14.2 per cent of the vote in the Berlin state election.
"We do not see ourselves as being in opposition over a long period," said AfD national leader Frauke Petry.
Merkel's lengthy statement on her refugee policy came ahead of another three state elections and a federal election next year.
The chancellor also has to lay aside differences between the CDU and its Bavaria-based allies, the Christian Social Union (CSU), over her refugee policy in the run up to December's CDU party congress.
Berlin Social Democrat Mayor Michael Mueller is now expected to replace the SPD-CDU coalition that has ruled the city for the last five years with a new three-party alliance comprising the SPD, the environmentalist Greens and the hard-left Die Linke.
Merkel accepted responsibility for Sunday's vote, which was the CDU's worst ever result in the city, saying she planned to strive to explain her government's stance on refugees much better.
She has also decided against repeating her much-derided phrase "we can manage it," which she first used over year ago just as the influx of refugees was beginning to grow.
The phrase had formed part of her attempt to explain Berlin's goal in dealing with the flood of newcomers but it had since been misinterpreted and was seen by some as provocative, Merkel said.
She also confronted critics who have called on her to step aside as a result of the refugee crisis, saying: "Germany is going to change, but its foundations will not be shaken."
But she said she recognized that Germans did not want the country to face uncontrolled migration, saying that it was also her goal to head off unregulated flows of people into the nation.
The chancellor defended the European Union deal with Ankara, which has earmarked billions of euros in humanitarian aid for Turkey in return for its help as a major transit country in reducing the flow of migrants to the EU.
But she once again rejected the CSU call for Berlin to impose an upper limit of 200,000 refugees a year, acknowledging that some work has to be done in improving relations between the CDU and the CSU.