Officials closed off the city centre of this southwestern German city Sunday evening after ammonia fumes overcame several people, DPA reported.
The apparent leak from a brewery was shut off in little more than two hours, a spokesman for local government said.
"We have the situation under control, there is no longer a health threat," the spokesman said.
The leak occurred about 7 pm from a refrigeration appliance at the brewery. Police instructed people who were out and about in the town, including at the market square, to leave the downtown area.
Three people were treated for respiratory inflammation, the German Red Cross said.
Hamburg residents were instructed in radio broadcasts to keep windows and doors closed.