Tradition, based on the Pali commentaries, attributes the Metta Sutta to the historical Buddha himself. The actual canonical text is silent on this matter. While much of the material in the , which is believed to have possibly been a didactic manual for novice monks) is generally assessed to have been added centuries after the historical Buddha's passing, many scholars consider parts of this collection (such as the 's fourth and fifth chapters) to be among the oldest parts of the Canon.Based on the aforementioned tools of historical assessment, at this time, there is no definitive identification of when the Metta Sutta per se was composed.The Pali Canon is believed to have been first written down in the first century BC.The Metta Sutta is found in the Sutta Piṭaka's fifth and final collection, Khuddaka Nikāya.It is ten verses in length and it extols both the virtuous qualities and the meditative development of mettā (Pali), traditionally translated as "loving kindness" "goodwill", underscores that the practice is used to develop wishes for unconditional goodwill towards the object of the wish. In Theravāda Buddhism's Pali Canon, mettā is one of the four "divine abodes" (Pali: brahmavihāra) recommended for cultivating interpersonal harmony and meditative concentration (see, for instance, kammaṭṭhāna).The other, also chanted by Theravadin Buddhist monks at times, extols the benefits of the practice of mettā (Pali) and it is found in the Anguttara Nikaya (AN 11.15). In later canonical works (such as the Cariyāpiṭaka), mettā is one of ten "perfections" (pāramī) that facilitates the attainment of awakening (Bodhi) and is a prerequisite to attaining Buddhahood.
The discourse identifies fifteen moral qualities and conditions conducive to the development of mettā.
Unlike these aforementioned discourses (although typical of many discourses in the Sutta Nipāta), the Metta Sutta itself does not directly attribute its words to either the Buddha or anyone else.
That is, the Metta Sutta text itself does not identify its own speaker.
According to post-canonical Sutta Nipāta commentary, the background story for the Mettā Sutta is that a group of monks were frightened by the sprites in the forest where the Buddha had sent them to meditate.
When the monks sought the Buddha's aid in dealing with the sprites, the Buddha taught the monks the Mettā Sutta as an antidote for their fear. Their good cheer then happened to quiet the sprites as well.