Once, a demon named Tripur pleased Lord Brahma and got the boon of immortality. Tripur became arrogant. He started troubling all the Devas.
The Devas sought refuge with Lord Shiva, and asked him to destroy the demon. After a fierce battle, Lord Shiva decided to use ‘Pashupat Astra’, his most destructive weapon. The Pashupat Astra was never to be used against ordinary enemies as it was capable of destroying all creation. Lord Shiva thus destroyed Tripur. The place where this incident took place became famous as Ujjaini.