Hamburg has withdrawn from the race to host the Summer Olympics in either 2036, 2040 or 2044 after residents rejected the idea at a referendum on Sunday.

Hamburg was one of four cities or regions bidding to be selected by the German Olympic Federation (DOSB) to host the Games, alongside Berlin, Munich and the Rhine-Ruhr region.

City officials had hoped to illustrate public support with a positive result. With 98 percent of ballots counted, 55 percent of voters rejected the idea, compared with 45 percent in favour.

Almost 50 percent of eligible voters cast their ballot in the referendum.

This is the second time in just over a decade Hamburg voters decided against hosting the Olympics. In 2015, 51.4 percent of voters rejected a proposal to host the 2024 Games.