According to Devi Bhagavata Purana, Madhu and Kaitabha originated from Lord Vishnu's earwax and performed a long period of tapas devoted to goddess Mahadevi. The goddess granted them the boons of invincibility and voluntary death. The proud-filled demons then started attacking Brahma. Brahma sought Vishnu's help but was unable to awaken Vishnu who was still in deep meditative sleep. Brahma then prayed to Mahadevi and she helped awaken Vishnu. The two demons then fought against Vishnu and defeated him. Upon advice from Mahadevi, Vishnu employs a trick to destroy the two demons. Vishnu praises the battle powers of the two demons and says that he is pleased to grant them boons. The boastful demons, proud of their victories against Vishnu, say that they are willing to grant him boons instead. Vishnu cleverly asks Madhu and Kaitabha for their lives and they are forced to kill each other.