According to folklore, a Bhaktapur King who was a great devotee of Lord Pashupati, had a dream in which Lord Shiva told him to build a temple for him so that he could move into it. He obeyed this command and thus the temple came into existence.