Once a brahmin, well versed in the Vedas, wished to slay a goat at the Feast of the Dead (Matakabhatta), and sent his pupils to bathe the goat in the river. After the bath, the goat remembered its past lives and knew that after its death that day it would be free from misery. So it laughed for joy. But it saw also that the brahmin, through slaying it, would suffer great misery, and this thought made it weep. On being questioned as to the reason for its laughing and its weeping, it said the answer would be given before the brahmin. When the brahmin heard the goat's story, he resolved not to kill him; but that same day, while the goat was browsing near a rock, the rock was struck by lightning and a large splinter cut off the goat's head. The Bodhisatta, who was a tree sprite, saw all this and preached the Law to the assembled multitude.
The story was told in reference to a question by the monks as to whether there was any good at all in offering sacrifices as Feasts for the Dead, which the people of Sāvatthi were in the habit of doing. J.i.166ff.