A mantra is a sound or a combination of sounds used as a spell. The 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. Some of these mantras consisted of lines or verses from the Vedas, but single syllables like hum were being used too (Vin.I,3). The Buddha rejected the efficacy of mantras as he did all forms of magic and replaced it with the idea that the greatest strength and protection comes from having a pure mind. In the Vinaya he says that the enlightened person will not chant hum (Vin.I,3). The Sutta Nipata says that chanting mantras, making offerings and performing sacrifices (mantahutiyanna), i.e. the central sacraments of Brahmanism, could not help someone plagued by doubt (Sn.249). In the Jatakas there is a story he told 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 exploits, lies or drinks alcohol. We cultivate love, practise generosity, repair roads, construct watering holes 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 Hinduism incorporated into some schools of Mahayana and later more so into Vajrayana. In fact, mantras became so central within Vajrayana that this Buddhist movement was sometimes also called Mantrayāna.