Media report said county spokeswoman Sandra Lummitsch heard the shots in a nearby office. She alerted the police and then locked herself in the office with her colleagues.
Police said the shooting was pre-planned, as the offender had made an attempt for days to get an appointment with the mayor.
Police said there was a physical confrontation between the gunman and the mayor before the shooting.
The revolver that the gunman used was illegally possessed, police said.
Ruediger Butte, 63, directed the State Criminal Investigation Office of Lower Saxony from 2001 to 2005, and became the mayor of Hamelin-Pyrmont county in 2005.