First recorded in the Yuan-dynasty zaju play 《
桃花女》 (Peach Blossom Girl), Act 3:
又犯着金神七煞上路,
又犯着太岁,
遭这般凶神恶煞,
必然板僵身死了也 — describing astrologically inauspicious 'malign deities and evil stars' that bring death.
煞 in folk religion meant a fierce malevolent spirit; the original meaning was supernatural, and the vivid imagery extended to flesh-and-blood thugs over time.