Updated 12:27 p.m. ET
BERLINA gunman took three people hostage at the city hall in the Bavarian city of Ingolstadt on Monday, officials said, and the standoff forced Chancellor Angela Merkel to cancel an election rally there. He was later arrested and all his captives freed unharmed.
The hostage-taker was a young man armed with a handgun, though it wasn't clear whether it contained live ammunition, police spokesman Hans-Peter Kammerer said. The incident started shortly before 9 a.m. (0700 GMT) Monday. It is not yet clear how the incident ended.
One of the hostages was a deputy mayor, Sepp Misslbeck. He was freed some five hours into the standoff, police spokesman Josef Petzenhauser.
It wasn't immediately clear how he was released.
Bavaria's state interior minister, Joachim Herrmann, said the hostage-taker had previously stalked a female employee at the city hall, German news agency dpa reported.
Mayor Alfred Lehmann said the man "wants us to reverse a decision." He said it wasn't immediately clear what decision he meant, but he may have been referring to the fact he had been barred from Ingolstadt's city halls.
The old city hall, one of two city halls in Ingolstadt, dates back to the 14th century, though the building was expanded in the 19th century. It is home to the mayor's office and the city's tourist information office, among other administrative departments.
The hostage-taking happened several hours before Merkel was due in the city for a late afternoon rally that was to take place on the square in front of the city hall. Germany holds national elections on Sept. 22, and Bavaria votes in a state election a week earlier.
There was no indication of any connection between the visit and the hostage-taking. However, Merkel's conservative Christian Democratic Union said it decided to cancel the rally.
Ingolstadt is located some 44 miles north of Munich and has about 125,000 inhabitants.