In ancient times, the city was called Ujjayini. As mentioned in the Mahabharata epic, Ujjayini was the capital of the Avanti Kingdom. Traditionally exalted as one of the seven sacred cities (Sapta Puri) of the Hindus, Ujjain is one of the four sites that host the Kumbh Mela (also called the Simhastha Mela), a quadrennial mass pilgrimage that attracts millions of Hindu pilgrims from around the country. It is also home to the Mahakaleshwar Jyotirlinga, one of the twelve Jyotirlinga shrines to the god Shiva. An ancient seat of learning, Ujjain is the place where Lord Krishna, along with Balarama and Sudama, received his education from Maharshi Sandipani.
In Indian mythology, the origin of the city is ascribed to the act of Sagar Manthan, which refers to the churning of the primordial ocean performed by the demigods and demons to discover a pot containing the nectar of immortality. The story goes that after the nectar was discovered, a fierce struggle ensued between the demigods and the demons to obtain the nectar for the attainment of immortality. During the chase, a drop of nectar spilled and fell on Ujjain, thus making the city sacred. According to legend, the river Kshipra that flows across Ujjain is regarded to have originated owing to the churning of the gods and goddesses.
Apart from the rich tapestry of myths and legends surrounding the city, Ujjain has stood witness to a long and distinguished history: it was home to legendary rulers including the renowned king Chandragupta II, great scholars such as Brahmagupta and Bhaskaracharya, and literary gems like Kalidasa. Since the 4th century BCE, the city was considered the prime meridian by Hindu astrologers, and it was placed as the center of the world in numerous ancient world maps. In the past, Ujjain was variously known as Arin, Aryn or Ozein to the outside world.