The earliest and best-known Sanskrit text consistently glorifying Devī as the supreme and autonomous creator, preserver, and destroyer of the universe. Probably composed in the 6th century ce, the Devī Mahātmya was a thirteen-chapter addition (Chs. 81–93) to the (c.4th-century ce) Mārkaṇḍeya Purāṇa, although its significance as a source for the mythology, theology, and ritual culture associated with the Goddess has resulted in it being treated, like the Bhagavadgītā in the Mahābhārata, as a textual authority in its own right.
Within a framing story, the Devī Mahātmya treats of three episodes displaying the Goddess's saving power in relation to other deities and the universe at large, and therefore, by extension, her power to save her devotees. In the first, she is depicted as the force underlying the universe, which enables Viṣṇu to defeat Madhu and Kaiṭabha, threatening demons who have emerged from the dirt or wax in his ear. The Goddess is characterized as Yoganidrā (‘sleep of yoga’); only when she agrees, at Brahmā's request, to leave Viṣṇu's body can he awake from his absorption, prior to creation. The story is therefore also related to cosmogonic power. In the second episode, the Goddess, in the founding version of what comes to be her best known myth, is brought into being by the fused lustre (tejas) of all the gods, including Śiva and Viṣṇu, in order to rid them of the demon Mahiṣa (Mahiṣāsura), who has appropriated their powers. Kitted out by the gods with weapons, ornaments, and a lion mount, the beautiful Goddess lays waste Mahiṣa's armies, and then confronts Mahiṣa himself, who has now taken the form of a buffalo. In an incident that subsequently became a favourite subject for sculptors and painters, the Goddess, riding her lion, fells the buffalo, plants her foot on its neck, and decapitates the demon as he emerges from its body. So the gods and the world are saved, and the Goddess duly praised by the gods for accomplishing something they could not. In the third episode, the Goddess is again called upon to save the world from the demon brothers, Śumbha and Niśumbha. A variety of different goddesses appear, including Pārvatī, Ambikā, Kālī, and Cāmuṇḍā; these are shown to be essentially one with each other and identical with Devī. In a similar fashion, the ‘seven mothers’ (saptamātṛkās) emerge as śaktis from the bodies of seven gods during the battle, and are eventually absorbed into the body of the victorious Goddess. The episode ends with the gods addressing a bhakti infused hymn of praise, the Nārāyaṇī Stuti, to the Goddess, in which, in spite of her many names, she is represented as being the singular and all-powerful creator, preserver, and destroyer of the universe, and the liberator of her devotees.
The Devī Mahātmya's popularity is largely attributable to its recitation, as a vehicle of bhakti and a means of wish fulfilment, in a wide variety of ritual contexts, especially those involving an animal sacrifice. The most notable occasion of this kind is the autumn Navarātrī or Durgā-pūjā (in Bengal), when the text is recited on each of the nine days of the festival for the benefit of both listeners and reciters.