At one time when the Buddha was staying at Vesālī in the pavilion of the Gabled Hall in the Great Wood, the lord talked in many ways to the monks on the subject of the impure and to develop (contemplation of) the impure (asubhabhāvanā). When he subsequently entered solitary retreat for a half-month many of the monks dwelt intent upon the practice of developing (contemplation of) the impure in its many different aspects. But they became troubled by their own bodies, ashamed of them, loathing them.
Some monks came up to Migalaṇḍika, a sham recluse, and asked him: “Be so good, your reverence, as to deprive us of life; this bowl and robe will become yours”. Then Migalaṇḍika, the sham recluse, a hireling for a bowl and robe, deprived the company of monks of life taking a blood-stained knife.
Then while Migalaṇḍika was washing the large blood-stained knife, he became remorseful and repentant. Though he washed the blood from the sword the anguish of guilt remained. He was sitting by the river in bitter repentance at what he had done when a certain devatā appeared, coming towards him on unbroken water. The devatā was of the retinue of Māra himself and in order to tempt Migalaṇḍika further it told him that he had nothing blameworthy; on the contrary he had made much merit for he had brought many monks across from the whirlpool of saṃsāra. Migalaṇḍika believed the devatā and set off back to the monastery with gusto, anxious to make even more merit. Migalaṇḍika took a sharp knife and went from dwelling to dwelling (vihāra), cell to cell (kuṭi to kuṭi), and called out, “Who has not crossed? Whom do I bring across?” Then those monks who were not devoid of passion were frightened, but those monks who were devoid of passion at that time were not in a state of consternation. Then, up to sixty monks on a single day, were deprived of their lives by Migalaṇḍika.
When the Buddha, at the end of the half-month, arising from his retreat for meditation, he addressed the venerable Ānanda, “Ānanda, how is it that the company of monks is so diminished as it is?” Then, on hearing the whole story, the Buddha called all the monks dwelling in the area together in the assembly-hall and it was on this occasion that he delivered the teaching on the concentration with mindfulness on breathing (ānāpānasati). Following that discourse, the Buddha laid down the training rule concerning the killing of people:
Should any monk deliberately deprive a human being of life, or search for an assassin for him, or praise the advantages of death or incite him to die (thus): “My good man, what use is this miserable, difficult life to you? Death would be better for you than life.” Or with such thoughts in mind, such intentions in mind, should he in various ways praise the advantages of death or incite him to die, he is also defeated and no longer in communion.
Reference: (Horner, London 1949), The Vinaya-Piṭaka, (The Book of Discipline), Vol.I, The Suttavibhaṅga, Parājika (Defeat) III, p.116–150.