1. Metta Sutta. One should be diligent and upright, gentle and not vain glorious, free from deceit. Let none, out of anger, or through resentment, wish misery to another. A person should cherish boundless goodwill towards all beings, like a mother fostering her only son. SN.vss.143-52; also Khp.p.8f.; where it is called Karaniyametta Sutta, by which name it is more popularly known.
This sutta was preached by the Buddha to five hundred monks who had obtained from him a formula for meditation and dwelt in a region in the Himālaya. The gods there were alarmed by the goodness of the monks and tried to frighten them away. The monks, constantly harassed, sought the Buddha at Sāvatthi. He preached this sutta to them and admonished them on the practice of goodwill. They followed his advice, and the gods, understanding, left them in peace (KhpA.232ff.; cp. DhA.i.313ff).
The sutta is included in the Parittas.
2. Metta Sutta. Once when the Buddha was at Haliddavasana, a discussion arose between some monks and some Paribbājakas as to whether there was any difference between their respective doctrines since they both inculcated the practice of goodwill, compassion, sympathy, and equanimity. The monks consulted the Buddha, who told them that the Paribbājakas were ignorant of how to cultivate these qualities, of what was their goal and their excellence, their fruit and their ending.
He then proceeded to explain to them that these are cultivated through the seven bojjhanga; goodwill has the "beautiful" for its excellence, compassion the infinity of space, sympathy the infinity of consciousness, and equanimity the sphere where nought exists. (S.v.115f).