Is the murder the mayor committed actually relevant to this case?
If so, then:
The mayor committed a murder, for reasons as of yet unknown. Someone who knew the victim, found out about this crime, and decided to take it into their own hands. They had been waiting for a chance to kill the mayor, and the confession was when they decided to strike.