The mayor has been mentioned many times throughout the show. This is the first episode he is shown in.
Amy Poehler once said that she would want Bill Murray to play mayor Gunderson if we ever got to see the character.
Bill Murray: often told Amy Poehler that he wanted to make an appearance as Pawnee's long-mentioned but never-seen Mayor Gunderson. When Season 7 was wrapping up the series, Poehler had the idea to have Gunderson die and finally reveal Murray to be him as he lain in state in his coffin. Murray loved the idea and immediately arrived on the set to film the scene, which took only a few hours.