A mantra (Pàëi manta) is a sound or a combination of sounds used as a spell. Brahmanism at the time of the Buddha taught that repeating certain mantras would impart spiritual power and blessings and evoke the help of the gods. The Tipiñaka mentions a sage named Araka who taught the doctrine of `enlightenment through chanting a mantra' (mantayàbodhabbaü. A.IV,136).

Some mantras consisted of lines or verses from the Vedas, but single syllables such as hum were used too. In the Vinaya the Buddha said that the enlightened person will not chant hum (Vin.I,3). Skill in Vedic mantras, he said, guarantee neither regard or virtue. `Brahmins are born into scholarly families, have mantras as their kinsmen, and yet again and again they are seen doing evil deeds. For this they are blamed here and have a bad destiny hereafter' (Sn.140-1). The Sutta Nipàta says that chanting mantras, making offerings and performing sacrifices (mantahutiya¤¤a), i.e. practices so central to   Brahmanism, could not help someone plagued by doubt (Sn.249). The Buddha rejected all forms of magic and replaced it with the idea that the greatest strength and protection comes from acting ethically and having a pure mind. For this reason the Milindapa¤ha called the Buddha's Dhamma the highest mantra (uttaraü mantaü, Mil.11). 

 The Jàtaka includes a story about a group of virtuous men who were falsely accused of doing wrong and were sentenced to be trampled by elephants. But try as he might, the executioner could not get the elephants to kill the men. Assuming that they must be reciting some protective spell or incantation the executioner asked them: `What is your mantra?' The leader of the men replied: `We have no mantra other than this, that none of us kills, steals, sexually misconducts ourselves, lies or drinks alcohol. We cultivate love, practise generosity, repair roads, construct wells and built rest houses for travellers. This is our mantra, our protection and the thing by which we flourish'(Ja.I,200).

The use of mantras was an aspect of Brahmanism that became so central to Vajrayàna   that this school of Buddhism is sometimes also called Mantrayàna. Vajrayàna Buddhism in Japan is called Shingon, the Japanese word for mantra. See Brahmins and  Hospitality.