Pashupatinath, or Pashupati, is a Hindu temple on the banks of the Bagmati River in Deopatan, a village 3 km northwest of Kathmandu. It is dedicated to a manifestation of Shiva called Pashupati (Lord of Animals). It attracts thousands of pilgrims each year and has become well known far beyond the Kathmandu Valley. The temple is barred to non-Hindus, but a good view of the temple can be had from the opposite bank of the river.
It is not known for certain when Pashupatinath was founded. Tradition says it was constructed by Pashupreksha of the Somadeva Dynasty in the 3rd century BC, but the first historical records date from the 13th century. The ascetic Pashupata sect was likely related to its foundation.
Pashupati was a tutelary deity of the ancient rulers of the Kathmandu Valley; in 605 AD, Amshuvarman considered himself favored by his touching of the god's feet.
By the later Middle Ages, many imitations of the temple had been built, such as in Bhaktapur (1480), Lalitpur (1566) and Benares (early 19th century). The original temple was destroyed several times until it was given its present form under King Bhupalendra Malla in 1697.
According to a legend recorded in local texts, especially the Nepalamahatmyaand the Himavatkhanda, the Hindu god Shiva once fled from the other gods inVaranasi to Mrigasthali, the forest on the opposite bank of the Bagmati River from the temple. There, in the form of a gazelle, he slept with his consort Parvati. When the gods discovered him there and tried to bring him back to Varanasi, he leapt across the river to the opposite bank, where one of his horns broke into four pieces. After this, Shiva became manifest as Pashupati (Lord of Animals) in a four-face (chaturmukha) linga.