The monk Vakkali is sick, afflicted, stricken with a sore disease. Vakkali called to his attendants to go to visit the Buddha and worship him at his feet in Vakkali’s name. Thereupon the Buddha went to visit Vakkali. Now the venerable Vakkali saw the Buddha coming, while yet he was afar off, and on seeing him he stirred upon his bed. When the Buddha sat down on a seat made ready he asks Vakkali about his sickness, if he is suffering from a lot of pain. Vakkali answers he is not bearing up and he is not enduring the strong pains since there is no sign of their abating, but of their increasing. Then the Buddha having taught the venerable Vakkali a lesson on impermanence, he rose up and went away to Vulture’s Peak.
Now not long after the departure of the Buddha, the venerable Vakkali called to his attendants to lift his bed and go to Black Rock on the slope of Seers’ Hill , for he did not want to end his life within a house.
Now the Buddha spent the rest of that day and the night at Vulture’s Peak. Then when the night was waning two devascame to the Buddha and said to him that brother Vakkali is bent on release, for he will surely win the utter release. When that night was spent the Buddha called to the brethren to go to brother Vakkali and tell him about the words spoken by the devas. And as to that, the Buddha tells Vakkali not to fear, for his dying and ending will not be evil.
Then the venerable Vakkali, not long after the departure of those brethren telling him the words spoken by the devasand the Buddha himself, he drew a knife and slew himself. At that time a smoky cloud, a mass of darkness in the sky was moving in all directions. The Buddha said to the brethren that this is Māra, the evil one. He is searching for the consciousness of Vakkali. But with consciousness not stationed anew anywhere, Vakkali the clansman is utterly well.
Reference: (Woodward, London 1975), The Saṃyutta Nikāya (The Book of Kindred Sayings), Part III, Vakkali, p.101–6.