A man shot dead 12 people in a rampage in a small town in Montenegro before turning his gun on himself early on Thursday, authorities said, in one of the Balkan nation's worst mass killings.