The term Kedar itself means a natural rock formation or a glacial moraine. The most famous legend about Panch Kedar relates to the Pandavas, the heroes of the Hindu epic Mahabharata. The Pandavas defeated and killed their cousins the Kauravas in the epic Kurukshetra war (Mahabharat). They wished to atone for the sins of committing fratricide and killing of Brahmins during the war. Thus, they handed over the reigns of their kingdom to their kin and left in search of the god Shiva and to seek his blessings.
But, Shiva assumed the form of a Nandi and hid in the Garhwal region to avoid Pandavas as he was deeply hurted by Mahabharata War.
Pandvas saw a bull grazing near Guptakashi while searching for Shiva. Bhima immediately recognized the bull to be Shiva. Bhima caught hold of the bull by its tail and hind legs. But the bull-formed Shiva disappeared into the ground to later reappear in parts, with the hump raising in Kedarnath, the arms appearing in Tunganath, the nabhi and stomach surfacing in Madhyamaheshwar, the face showing up at Rudranath and the hair and the head appearing in Kalpeshwar.
The Pandavas pleased with this reappearance in five different forms, built temples at the five places for venerating and worshipping Shiva. The Pandavas were thus freed from their sins. It is also believed that the fore portions of Shiva appeared at Pashupatinath, Kathmandu – the capital of Nepal. After building the Panch Kedar temples, the Pandavas mediated at Kedarnath for salvation, performed yagna and then through the heavenly path called the Mahapanth attained heaven or salvation.