Om Triyambakam Yajamahe, Sugandhim Pushti Vardhanam, Urva Rukam Ev Bandhanan, Mrityurmoksheyam Amretaat
Translation: om (sacred syllable), the three-eyed God who sees what we can see and also sees what we can not see, I invoke you, increase my good vasanas, my souls bound to the body, please free me from the captivity of death and give me immortality.
This mantra was originally known only to Sage Markandeya. Rishi Mrikandu and his wife Marudmati had no children, so they used to offer various yagnas to please Lord Shiva. Pleased by their prayers, Lord Shiva gave them two options. Either they could have an intelligent boy with a short life, or a boy with a long life but less intelligence.
Rishi Mrikandu chose the first option. Lord Shiva granted his wish and very soon a boy was born to Marudmati. They named the boy Markandeya. Markandeya was highly intelligent and had learned all the scriptures at a very young age. A boy of calibre, Markandeya had been granted a lifespan of just sixteen years.
When he had completed fifteen years of his life, his parents started worrying more about him. Though they wanted to keep it a secret from Markandeya, he detected that there was something that had been constantly worrying his parents. When he came to know that it was his short lifespan that was worrying them, he decided to please Lord Shiva, who was the lord of destruction.
Markandeya sat to worship Lord Shiva in front of the Shivalinga. It is believed that when the agents of Yamraja (the lord of death) came there to take him, they too sat for the puja, impressed by the devotion of Markandeya. As a result, Yamraja himself came to take him away.
But seeing the devoted sage-boy Markandeya clinging to the Shivalinga very tightly, Yamraja's heart melted. However, it is said that Yamraja cannot change anything once the death of a person has been decided. He has to discuss with all the other gods before changing the timings of a person's death.
He tried to pull him away from the Shivalinga, during which Yamraja slipped and fell on the Shivalinga. This enraged Shiva, upon which he appeared before Yamraja and warned to kill him if Markandeya's life was not extended. This is why Yamraja increased his life, to pacify the anger of Lord Shiva.
Mahamrityunjay mantra is considered as one of the most powerful mantras of Lord Shiva. It bestows on us better mental, physical and emotional health. It is believed that when it was used by Sati for the moon, Lord Shiva placed him on his head. Addressed to Lord Shiva, this mantra can ward off untimely death.
While the Gayatri mantra is chanted for spiritual guidance and purification of the soul, Mahamrityunjaya Mantra is chanted for rejuvenation and nurture.
It is said that it was the Mahamrityunjaya Mantra which the sage used to chant while worshiping Lord Shiva in front of the Shivalinga. He was the only man who knew this. This mantra was further given by him to the moon, to Sati and to the daughter of King Daksha, when Daksha had cursed the moon.
According to yet another story, this mantra was given to Shukracharya who further gave it to Rishi Dadhichi, who then have it to Rishi Kshuva, from where it reached Shiva Purana. It was then revealed by Rishi Kahola.