The city state has been governed by a coalition of the center-left Social Democrats and the environmentalist Green party for the last five years. They are the two leading parties, according to polls.
Days before the vote, incumbent mayor Peter Tschentscher of the Social Democrats unveiled plans to shut down a modern coal-fired power plant and make the city center largely car-free. His party had a solid lead of 15 percentage points in recent polls, though the Greens look to double their share of the vote compared with 2015.
The Green party has pledged to make the city of 1.8 million people climate neutral by 2035 — far sooner than the national goal of ending greenhouse gas emissions by 2050. Its local leader Katharina Fegebank joined students and Swedish campaigner Greta Thunberg at a protest Friday calling for action to curb global warming.
Hamburg, which is also one of Germany's 16 states, has a strong interest in combating climate change. Rising sea levels and more violent weather could imperil the port city, where a devastating storm surge in 1962 remains part of the collective memory.
The city is investing hundreds of millions of euros (dollars) in raising dikes and recently agreed to a climate action plan that includes requiring all new buildings to have solar panels from 2023.