Merkel had been due to appear in Ingolstadt and Regensburg as part of a campaign tour that will see her pass through over 50 German towns and cities ahead of a Sept. 22 election. Bavaria is holding a regional election one week before the federal vote.
The hostage-taking was ended shortly before 6pm (local time), after nearly nine hours, when police special forces overwhelmed the hostage-taker, according to German media reports.
Associated Press is reporting that police shot and wounded the captor.
The man had earlier released one of the three hostages, a deputy mayor, five hours into the standoff, police said. Officials said there was no connection between the hostage-taking and Merkel's visit.
A Bavarian official said that the hostage-taker had been stalking the deputy mayor's secretary. Authorities had evacuated the town hall all day and closed off the immediate area.
According to the city's website the town hall is a 14th century building, home to the mayor, some administrative posts and the tourist office. Ingolstadt, a city of roughly 125,000 near Munich, is best known as the home of Audi, the luxury unit of German carmaker Volkswagen.