Once there lived a sage named Mrikandu with his wife Marudavali , the couple were childless. They worshiped lord Shiva for a child,one day lord Shiva appeared before them and asked if they wanted an ordinary child with a long life or a child with exceptional intelligence with a short life. Sage Mrikandu asked the lord for a child who would be an intelligent and a good son. In due course Marudavali gives birth to a son who would only live for sixteen years. The couple name him Markandeyan, the child as promised by the lord showed great understanding of the scriptures and at a very young age became an accomplished sage.
Markandeyan in his sixteenth year knew his time on earth was going to end. He was in the temple worshiping lord Shiva in the form of a Shivalingam,on seeing Kalan(or yama,the god of death) come towards him, Markandeyan clutched the shivalingam and prayed to lord Shiva to protect him. Kalan approached Markandeyan and threw his noose around him ,the noose also encircled the shivalingam which Markandeyan was hugging. Lord Shiva exploded out of the Lingam with great fury and struck down Yama for encircling the lingam with his noose . He blessed the boy-sage Markandeyan with eternal life always at the same age of sixteen.
With Kalan gone , there was no death on earth and Bhumadevi (goddess earth) worshiped to the Lord saying that she cannot bear such a huge burden. And in answer to her prayer lord Shiva revives Kalan.
The story is thus believed to have taken place in Tirukkadaiyur in Tamil Nadu, the place is now celebrated as a place where death itself died. People visit this place for good health and long life.