The fiftieth sutta of the Majjhima Nikāya.
While Moggallāna is living at Bhesakalāvana, Māra enters his belly and worries him. When Māra realizes that Moggallāna has discovered him and can read his thoughts, he leaves his body and perches on the door bar of his cell. Moggallāna then addresses him and tells him how, once, he himself was a Māra named Dūsī, and roused the brahmin householders against Kakusandha Buddha and his disciples. As a result of this, Dūsī was born in Mahāniraya and suffered great torments. Moggallāna warns Māra against assailing holy men lest he suffer a similar fate. Māra retires discomfited. M.i.332-8.