A Forschungsgruppe Wahlen exit poll for CNN affiliate n-tv suggested the SPD had 25.7% of the vote, with the center-right Christian Democratic Union of outgoing Chancellor Angela Merkel on 24.6%, followed by the Greens at 14.4%, the FDP at 11.7% and the AfD at 10.7%.
The narrowness of the margins means the German elections are at this point too close to call and predicting the next government -- and chancellor -- is impossible. A large number of postal ballots also remain to be counted.
Whichever party comes out in front, lengthy coalition negotiations are expected before a government can be formed.
But for the SPD, coming out neck-and-neck with the CDU counts as a significant gain. The left-leaning party took 20.5% of the vote in the country's last general election, in 2017.
"The voters have decided that the Social Democratic party has gained, and this is a great success," said SPD leader Olaf Scholz in remarks at his party's headquarters.
Scholz said the voters wanted him to be next chancellor. "Many citizens have put their crosses next to the SPD because they want there to be a change in government and also because they want the next chancellor of this country to be called Olaf Scholz."
The 63-year-old politician has served as the vice-chancellor and German finance minister in Merkel's grand coalition government since 2018, earning him increased visibility as he navigated Germany's economic response to the pandemic.
"Pragmatism, optimism, unity that is what we will show because that is what counts, and I am sure the citizens will also be happy post election about their decision," Scholz added.
Loud applause and cheering from jubilant party supporters interrupted him as he spoke.
"Now we will await the final result, but then we will get to work. Thank you!" Scholz said.
Robin Fugmann, 20, an ardent Scholz supporter, told CNN he was delighted by the results so far.
"It is really an amazing result, people believe in Olaf Scholz, people believe that Armin Laschet really cannot lead this country," he said. "So we really have the mandate to lead a new government -- I hope we will do so. And first of all we are going to celebrate because this is a really amazing result."
By contrast, the mood at CDU headquarters was downcast as the initial exit polls emerged. They suggest the CDU, with its sister party, the Christian Social Union in Bavaria, could be looking at the worst result in the alliance's history -- with its share of the vote potentially down more than 8% from 2017.
The party "cannot be content with this result," CDU leader Armin Laschet told supporters, while noting that the final result remained unclear.
"We can foresee that there could be a government with three parties," he said, as he said the party would "do everything to try to build a coalition."
Laschet added that the CDU had "got a mandate against a leftist government."
The party had campaigned on a message of stability for the country after Merkel, seen as a steady pair of hands over the past nearly 16 years, steps down. But it is now coming to terms with what it itself called a bitter night of losses.
"When we look at how we lost compared to the last election, it is bitter for us," CDU secretary-general Paul Ziemiak told CNN in an interview at party headquarters.
"But it is also clear that after the numbers there is not yet a clear view about who is ahead and exactly how," he said.
"The question is, who can form a stable government, form a coalition for the future, for this country? We have many issues to tackle -- climate protection, innovation -- but we also have to ensure stability and social security, which I believe a coalition of the CDU/CSU, the Greens and the FDP could do well, and that is what we will be talking about over the next few days."
The CDU's Peter Altmaier, who has been serving as the federal Minister of Economic Affairs and Energy, told CNN that the election result was "in no way a landslide victory for the opposition parties" and showed "a lot of confidence" in the CDU to govern.
Reflecting on the election, he added: "The clear message to all the people around the globe is that democracy in Germany is quite stable, this was not the day of extremist parties -- not from the left, not from the right -- it was the day of the conventional parties from the center of our democracy."
Deborah Piraba, a 27-year-old law student and Young Christian Union Democrat, told CNN at the CDU headquarters that the results were "disappointing" but that nothing was lost yet.
"We have to consider that we are coming out of 16 years with Angela Merkel, whom I am a big fan of. I am already sad she is leaving the office," she said. "We call her Mutti (Mom), she knew how to talk to people and has the connection with people and she has done so much for Germany. This made her so special comparing her with other politicians. I will also miss her sense of humor."
Meanwhile, the crowd at the Green party headquarters in Berlin cheered as the first exit polls were read out.
"We have led a campaign as we have never before experienced in this country -- around the clock, until last night, the last second," said Greens' leader Annalena Baerbock as she thanked party supporters.
Environmental concerns and economic worries have emerged as key issues in campaigning, with the former fueled by the deadly floods that devastated parts of Germany this summer.
Baerbock credited her party's success to young and new voters. "This momentum from the market places, from so many [people] who joined our party in the last years, has led to this historical best result," she said.
But, Baerbock added, the party had "wanted more" and had failed to do better in part because of mistakes by her during campaigning.
The AfD's lead candidate for chancellor, Alice Weidel, put on a brave face after projected election results showed support for the far-right party dropping by 2.6% from 2017.
"We are in the double figures, we have been able to assert ourselves," she said, according to Reuters. "This assertion that we would be gone from parliament after one legislative period has utterly failed and we are very very happy."
The outgoing government remains in office as acting government until it is replaced by a new government. Merkel, 67, will then stand down and the new chancellor will take the reins.
Even if the final result changes the vote distribution, the basic fact is "after 16 years in power, almost 76% of Germans have not voted" for Merkel's party, CNN commentator Dominic Thomas said.
Neither CDU nor SPD will have a real opportunity to create a coalition, he added.
"If it is the SPD that leads the way, the only path forward is going to be speaking to three parties that most likely will involve the Greens and the FDP. And that's quite a tall order trying to just bring all of those together," he said.
The exit polls indicate movement toward center and center-left., he added, reflecting the concerns of a younger electorate.
"It is clear that the momentum is moving more towards issues that concern social welfare, green politics," Thomas said.
The negotiations to form a coalition government could take weeks or even months. It took more than five months after the September 2017 election for a government to be formed under Merkel.