When the Buddha was residing at Rajagaha, three kinds of disaster struck the city of Vesali. The people were faced with famine, disease and harm caused by evil spirits.
Thousands of people died, and the remaining citizens of the city were desperate for help.
Suggested inviting the Buddha, the Great Compassionate One. On receiving the invitation the Buddha together with Venerable Ananda and the community of monks went to the city. When they arrived there, torrential rains poured down and swept away dead bodies and other evil things.
The Buddha taught Ratana Sutta (Discourse on the Precious Jewels) to Venerable Ananda and instructed him to walk around the city sprinkling holy water from the alms bowl of the Blessed One while reciting this protective discourse. By doing so the whole city was blessed, and all calamities gradually disappeared.
Thereafter, the Venerable Ananda reported to the Buddha, who was waiting for him at the City Hall of Vesali all that happened in the city. There the Buddha recited the same discourse and explained the gracious value of this Paritta to his disciples who were present.
[In the opening, the Buddha was pacifying the non-human and requesting them to listen to what is being said. In the second stanza, the non humans are being requested to protect the human beings because they make offerings to the former. From then onwards the stanzas glorify the Buddha, the Dhamma or the Sangha describing their virtues. After mentioning each set of qualities attributed to the Buddha, the Dhamma or the Sangha, the well-being is wished for as the result of the truth aforementioned in the particular stanza. Thus is evident the paritta (protection) quality of this sutta. The last three stanzas contain the homage of the non-humans to the Buddha, the Dhamma and the Sangha after the sutta was over, and their benediction. According to commentarial pronouncements the last three stanzas were uttered by Sakka, the lord of the devas.
This Sutta is found in the Khuddaka Patha and Sutta Nipaka Text.