One name of Lord Shankar is Tripurari too. In ancient times 3 terrible demons were born and they were brothers. Their names were different and like illusory cities they had built 3 magical cities. They had imprisoned all world denizens in these 3 cities. Every individual of these 3 cities were under their vision. They would think as per these demons thinking and execute tasks accordingly. Thus the entire world was under their illusory power wherein righteousness declined and unrighteousness waved its flag of victory. Demonic wealth grew and all the 3 cities appeared glorious. And yet everything within was dark and shady. These citizens lived a hell like life full of worries and strife. Everywhere people wailed aloud.
Righteousness complained to Prajapati. The latter requested Mahakal to intervene since he if the lord of reforms. He listened to what righteousness had to say so as to clearly understand the situation. Although the 3 demons who built these 3 cities were separate yet somehow they were intensely bound to each other. Their 3 cities appeared to be separate yet they nourished each other. These 3 demons could not die in an ordinary manner. They had attained a boon that they would die together and that too with a single weapon only. These demons were very wily hence they had asked for such a boon. They knew that it was well nigh difficult to kill even one of them hence who would take up the challenge of killing all 3 at one shot? Suppose someone dared to do so even then where was that single weapon which would kill all 3 at one and the same time? None could carry out this impossible task. Hence despite the fact that demons cannot attain immortality yet they lived lives as though they were immortal.
Lord Shiva cogitated over the situation and found a solution to free all of mankind from the clutches of these terrible demons. He created the Trishul weapon which had 3 prongs. These 3 prongs on one weapon would kill them simultaneously. Mahakal with great speed attacked the demons and thus the power of the 3 demons was burnt to naught. Righteousness won and unrighteousness was defeated. The deluded denizens of the 3 illusory cities were freed. Henceforth they started thinking independently and wisely and acted wholesomely. Thus a great calamity that fell on mankind was warded off. Lord Mahakal’s victory was eulogized by one and all and was now named Tripurari.