Germany’s center-left Social Democratic Party has secured a narrow victory over outgoing chancellor Angela Merkel's party in federal elections held on Sunday.

In its best result in years, the SDP, helmed by deputy foreign minister Olaf Scholz, won 25.7% of the votes, while Merkel’s conservative bloc led by Armin Laschet came second with 24.1%, Germany’s federal electoral commission said Monday.

The center-left captured 5.2% more votes than in 2017, as the conservative bloc formed by the Christian Democratic Union (CDU) and its Bavarian counterpart, the Christian Social Union (CSU), posted their worst ever results.

The Greens, led by Annalena Baerbock got 14.8% of the votes, followed by the Liberal Party (FDP) with 11.5%, according to preliminary results.

Both parties are expected to play key roles in coalition formation talks, with the SPD and CDU unlikely to continue governing together.