There is a legend found in Mahabharata about Shakti. Once King Kalmashapada, going hunting, killed many animals. Tired and being hungry and thirsty, he was proceeding through the woods. On the way, Shakti came on the same path, from the opposite direction. The King ordered him to get out of his way. The Rishi addressed the King sweetly and said "O king, this is my way". In accordance with duty and tradition, a king should always make way for Brahmins. The king persisted in acting like a Rakshasa (demon). The Rishi cursed the king thus: "O worst of the worst kings, since thou persecutest an ascetic, like a Rakshasa, thou shalt from this day, became a Rakshasa subsisting on human flesh! Henceforth, O worst of kings! thou shalt wander over the earth, affecting human form!".[2][3]
Cursed thus by Rishi Shakti, the Rakshasa(demon) first killed and swallowed Shakti himself. After that, Kalmasapada ate successively all the 100 sons of Maharshi Vasistha.[4]