German Chancellor Angela Merkel's conservatives have agreed terms for a coalition with the centre-left Social Democratic Party (SPD).
The late-night deal follows talks by SPD leaders with Mrs Merkel's Christian Democrats (CDU) and allied CSU.
She hailed the deal as "very much in the theme of mutual trust", while SPD leader Sigmar Gabriel said it was fair.
Mrs Merkel could be sworn in for a new term in office next month if SPD members ratify the deal.
The CDU/CSU fell short of a majority in September polls, and traditional coalition partner the FDP won no seats.