German politicians have achieved a breakthrough in talks aimed at forming a new coalition government.
A blueprint for formal negotiations was agreed between chancellor Angela Merkel's Christian Democrats (CDU) and their former coalition partners, the Social Democrats (SPD).
Politicians stayed up all night to discuss the 28-page document, with the talks lasting more than 24 hours.
But they managed to reach agreement on key sticking points such as migration.
They plan to limit asylum-seeker arrivals to about 200,000 annually. The blueprint also speaks of capping at 1,000 a month the number of migrants who will be allowed to join their family living in Germany.
Merkel and SPD leader Martin Schulz told a news conference they were optimistic that a new ‘grand coalition’ could be formed.
They spoke of a ‘fresh start’ for Germany, and Schulz said that in Europe ‘we are determined to deploy Germany's strength’. They signalled that a stronger alliance with France in the EU would be a priority.
Both stressed the need to ensure Germany's ‘social cohesion’.
It was a veiled recognition of voter frustration with centrist politics, amid tensions over the influx of asylum seekers.
The September election saw the far-right Alternative for Germany (AfD) win 94 seats in parliament - a first for post-war Germany.
Both the CDU and SPD suffered their worst election results for more than 50 years.
After a gruelling all-night session - fuelled by currywurst - Angela Merkel appears to have clinched the deal.
The breakthrough is no doubt a relief to the chancellor, who might have faced the prospect of fresh elections had the talks failed. But Merkel won't be cracking open the Sekt straight away.
These were just exploratory talks, aimed at establishing whether there's a basis upon which a coalition can be formally negotiated. Before the next round of talks can go ahead, the SPD must give the go-ahead at a special party conference.
Bear in mind that many in the SPD - which had originally refused to work with Merkel again - blame her for their disastrous election result, and are still uncomfortable about another four years in her shadow.
Even if they approve the negotiations, any coalition treaty will be put to the SPD's 400,000 members in a postal ballot. Merkel is not out of the woods yet.
The centre-right CDU and its Bavarian CSU ally have been unable to form a government since the inconclusive election.
Merkel admitted there had been difficult ‘blockages’ during the Berlin talks. Schulz said they had been ‘tense and turbulent’ at times, and ‘we argued very intensively’.
The German daily Die Zeit published the text of the CDU/CSU-SPD blueprint for formal negotiations.
The talks also focused on tax changes. The CDU is pushing to scrap the solidarity tax paid for developing former communist east Germany.
Initially the SPD ruled out governing with Merkel in charge again. But Schulz changed his mind after CDU coalition talks with the liberal Free Democrats (FDP) and Greens broke down.
It is Germany's longest ever post-war period of coalition-building and there is still a long way to go before a coalition deal can be clinched.
The SPD will hold a special congress in Bonn on January 21 to decide how to proceed.
Want stories like this in your inbox?
Sign up to exclusive daily email
More Stories from Europe