I have heard that on one occasion the Blessed One was staying among the Sakyans near Kapilavatthu in Nigrodha's Park. Then Mahanama the Sakyan went to the Blessed One and, on arrival, having bowed down to him, sat to one side. As he was sitting there, he said to the Blessed One, "Lord, this Kapilavatthu is rich & prosperous, populous & crowded, its alleys congested. Sometimes, when I enter Kapilavatthu in the evening after visiting with the Blessed One or with the monks who inspire the mind, I meet up with a runaway elephant, a runaway horse, a runaway chariot, a runaway cart, or a runaway person. At times like that my mindfulness with regard to the Blessed One gets muddled, my mindfulness with regard to the Dhamma... the Sangha gets muddled. The thought occurs to me, 'If I were to die at this moment, what would be my destination? What would be my future course?"
"Have no fear, Mahanama! Have no fear! Your death will not be a bad one, your demise will not be bad. If one's mind has long been nurtured with conviction, nurtured with virtue, nurtured with learning, nurtured with relinquishment, nurtured with discernment, then when the body — endowed with form, composed of the four primary elements, born from mother & father, nourished with rice & porridge, subject to inconstancy, rubbing, pressing, dissolution, & dispersion — is eaten by crows, vultures, hawks, dogs, hyenas, or all sorts of creatures, nevertheless the mind — long nurtured with conviction, nurtured with virtue, learning, relinquishment, & discernment — rises upward and separates out.
"Suppose a man were to throw a jar of ghee or a jar of oil into a deep lake of water, where it would break. There the shards & jar-fragments would go down, while the ghee or oil would rise upward and separate out. In the same way, if one's mind has long been nurtured with conviction, nurtured with virtue, nurtured with learning, nurtured with relinquishment, nurtured with discernment, then when the body... is eaten by crows, vultures, hawks, dogs, hyenas, or all sorts of creatures, nevertheless the mind... rises upward and separates out.
"Have no fear, Mahanama! Have no fear! Your death will not be a bad one, your demise will not be bad."