Lord Shiva is the main deity that is worshipped in the Mahakaleshwar temple and is also known as Maheshwara. Brahma, Vishnu, and Maheshwara form the trinity of Hinduism and Lord Shiva is referred to as Maheshwara in it. The word Mahakaleshwar means the Lord Of Time and according to Hinduism Lord Shiva is the God of Time. Lord Shiva is also known as Mahakal. The locals believe in two legends related to Lord Shiva being referred to as Mahakaleshwar.
One of these legends states that when Daksha, the father of Sati objected to her marriage with Lord Shiva, she walked into the fire. After hearing about it, Lord Shiva got furious and performed the Dance of Death or Tandava and so he was entitled with the name Mahakal or Mahakaleshwar and he was also called the God ahead of time. According to the other legend when the demon, Dushan hurt the devotees of Shiva, he was angry and broke earth into two halves, and then he was called Mahakaleshwar.