One of the suttas of the Khuddakapātha. It is also included in the Sutta Nipāta (vss. 222-38); see also Gangārohana Sutta. It was preached at Vesāli, on the occasion of the Buddha's visit there at the invitation of the Licchavis, who begged him to rid the city of the various dangers which had fallen upon it.
According to the Commentaries (SNA.i.278ff.; DhA.iii.436ff.; KhpA.164f), the Buddha first taught the sutta to Ananda and asked him to go round the city, accompanied by the Licchavi princes, reciting the sutta and sprinkling water from the Buddha's bowl. Immediately all the evil spirits fled from the city and the people recovered from their diseases. They then gathered at the Mote hall with various offerings and thither they conducted the Buddha. In the assembly were present not only all the inhabitants of Vesāli, but also the devas of two deva worlds, with Sakka at their head. The Buddha preached the Ratana Sutta to this great crowd. Another account, quoted by Buddhaghosa (DhA.iii.165), says that in the assembly the Buddha preached only the first five stanzas, the rest having been earlier recited by Ananda. Because this sutta was first preached to ward off the evil from Vesāli, it became the most famous of Buddhist Ward runes (Parittā)
The sutta consists of seventeen verses: the first two contain a request to the devas to receive the homage and offerings of men and protect them in their danger; then follow twelve verses, descriptive of the virtues of the Buddha, the Dhamma and the Sangha. It ends with three verses purporting (DhA.iii.195) to have been spoken by Sakka on behalf of all the devas, expressing their adoration of the Buddha, his Dhamma and his Sangha. It is also said (DhA.iii.196) that during this visit the Buddha stayed at Vesāli for two weeks, preaching the sutta on seven consecutive days; on each day eighty four thousand beings realized the Truth. The Sutta seems also to have been known as the Gangārohana Sutta (Cv.xxxvii.191).
When Ceylon was troubled by famine and plague in the reign of Upatissa II., the king had the sutta preached by monks while walking in the streets of the city. All troubles vanished, and he decreed that his successors should do likewise in times of need(Cv.xxxvii.195f). Sena II. had the whole sutta inscribed on a golden plate and held a great festival in its honour (Cv.li.79).
The sutta is given in the Mahāvastu (i.290ff), where it is described as Svastyanagāthā.
The Dīgha Commentary (DA.i.250) refers the reader to a Ratana Sutta of the Bojjhanga Samyutta for details of the seven gems of a Cakkavatti. The reference is evidently to the Chakkavatti Sutta. S.v.98.