After all votes were tallied, the SPD claimed 45.7 percent of the vote and will take 58 seats in the port city's parliament. It's slightly less than a majority, meaning Mayor Olaf Scholz will have to find a governing partner.
"We have ruled effectively and kept all of our problems. Hamburg will stay a Social Democratic city," Scholz told supporters after the tallies made it apparent his party would win the biggest number of votes.
"We will successfully accomplish this assignment we've been given. Everyone in this city can rely on that," he told crowds waving signs reading "Thank you Hamburg" at a former factory in the Altona district.
The Greens have already made signs that they are ready to negotiate to make a red-green governing coalition.
The typically reserved Scholz was visibly basking in his success of a second term, though at a loss: In the 2011 election, he and his party won an absolute majority. In Sunday's election, they captured 2.7 percent less votes than last time.
That's not as grim, however, than the results for Angela Merkel's party the Christian Democrats (CDU) as the party continues to lose in the hanseatic city. The CDU barely held on to its spot as second party with 15.9 percent of the vote – 6.1 percent less than what was captured in 2011 where the party lost more than 20 percent of votes.
It was the CDU's worst-ever results in the Hamburg and one of their lowest nationwide.
The Green party was hot on the CDU's heals with 12.2 percent of the vote. Die Linke (the Left) took 8.5 percent.
What the CDU lost was a gain for two other parties hinging big hopes on the Hamburg election, which was seen as a barometer for further upcoming elections around the country.
The ailing Free Democratic Party (FDP) was able to celebrate a win with 7.1 percent of the vote.
"What we had here in Hamburg was an ice-breaking vote," said Lindner who took over the party after it was thrown out of federal government for the first time in 2013. The former governing partner with the CDU failed to capture the five percent of the vote that is required to keep a presence in the Reichstag.
And the anti-euro upstart Alternative for Germany will also find a place in the Hamburg government for the first time after claiming 6.1 percent in its first-ever race in city.
"Now we have shown that we can also be successful in a liberal, cosmopolitan city like Hamburg," said party leader Bernd Lucke, a former economics professor at Hamburg University.
Hamburg is the fourth state parliament with AfD members.
Hamburg is home to Germany's largest port and one of three city states, with Bremen and Berlin, in the country.