Kedarnath has been a pilgrimage centre since ancient times. It is not certain who constructed the original Kedarnath temple and when. A mythological account ascribes the temple's construction to the legendary Pandava brothers mentioned in the Mahabharata. However, the Mahabharata does not mention any place called Kedarnath. One of the earliest references to Kedarnath occurs in the Skanda Purana (c. 7th-8th century), which names Kedara (Kedarnath) as the place where Shiva released the holy waters of Ganga from his matted hair, resulting in the formation of the Ganges river.