Angela Merkel apologises over Maassen's controversial promotion
Angela Merkel said she "regrets" her handling of a political scandal involving the country's top spy - who was effectively promoted after making controversial remarks.
Former domestic intelligence chief, Hans-Georg Maassen was told to quit after he cast doubt on reports of anti-migrant attacks in Chemnitz.
He was instead moved to the interior ministry - to a job which paid more.
"I regret very much that that was allowed to happen," Mrs Merkel said.
Mrs Merkel admitted that she had "focused too much" on the functioning of the interior ministry, and not on what people felt "rightly", when they heard about the promotion.
The resulting political fallout almost scuppered Mrs Merkel's delicate coalition, when her partners the SPD threatened to pull out.
Analysis: Undignified and damaging
Damien McGuinness, BBC News Berlin
The coalition has been saved. But all three party leaders have been damaged by the undignified squabble.
Angela Merkel was unable to fire an unruly subordinate who had overstepped his brief and publicly contradicted her — proving to critics that her authority is on the wane.
Andrea Nahles, leader of the centre-left SPD, has confirmed the worst fears of her rebels, who accuse her of betraying left-wing values, by entering into muddy compromises with the conservatives to stay in power.
But arguably Mrs Merkel's troublesome interior minister, Horst Seehofer, leader of the Bavarian conservatives, has been hit hardest. This is the second time in six months that a row over migration has threatened to bring down the coalition. In both cases he is generally seen as the instigator.
He appears to believe talking tough on migration will help him win back voters from the anti-migrant AfD in regional elections in Bavaria in October.
He has miscalculated. Voters suspect he is prepared to sacrifice long-term political stability for the sake of short-term electoral success.
Polls show that he is now one of the least popular politicians in Germany – and Angela Merkel remains the most popular.
A compromise deal was reached on Sunday. Under its terms, Mr Maassen will take on his role at the interior ministry as planned - but will not receive any pay increase.
Mrs Merkel said it was now time to turn the government's attention to real problems affecting Germans.
What happened to the spy chief?
Mr Maassen was the head of Germany's Federal Office for Constitutional Protection (BfV) - which is similar to the British MI5.
In late August, the fatal stabbing of German citizen Daniel Hillig in a street fight involving two foreign-born suspects led to an outbreak of far-right violence.
In the wake of the unrest, reports emerged of anti-migrant "hunts" in the form of xenophobic assaults.
Mr Maassen, however, cast doubt on such claims, saying there was no evidence of such "hunts" and questioned the truth of video evidence on social media.
His remarks proved controversial - as did the news that he had contacts with far-right Alternative for Germany (AfD) politicians.
- Germany jails Chemnitz Nazi salute man
- Germany's far right march en masse
- Are migrants driving crime in Germany?
The political fallout hit Mrs Merkel's coalition hard.
Sunday's compromise is an effort to heal the fractured coalition and move on from the scandal.
The SPD party is meeting Monday to discuss the deal and whether or not to leave the coalition - something that its leader Ms Nahles and other senior figures no longer want after reaching a deal at the weekend.