The historic stone gateway of Chaubis Khamba Mata Temple in old Ujjain, with small shrines in front

Ujjain · History & heritage

History of Ujjain: Avantika to the City of Mahakal

Ujjain's history from ancient Avantika and the Mauryas to Vikramaditya, Kalidasa, the Vedh Shala, the Paramaras and the Scindias.

Few Indian cities can claim as long an unbroken life as Ujjain. Over more than two and a half thousand years it has been a royal capital, a hub of trade, a seat of learning and one of the holiest cities of Hinduism. Its old names, Avantika, Ujjayini, Vishala, Padmavati and others, appear across the Puranas, the epics and classical Sanskrit poetry.

This page follows Ujjain from its beginnings on the Malwa plateau to the Maratha city that stands today. Where history and legend part ways, as they often do here, we say so. Further reading, including the district administration's own pages, is listed at the end.

Last reviewed

Avantika and the Avanti Mahajanapada

Ujjain rises from the eastern bank of the Shipra on the Malwa plateau. Historians regard Avanti, the kingdom whose capital it was, as one of the earliest urban outposts of central India. Early urbanisation is visible from around 700 BCE, and by about 600 BCE Ujjain was the political, commercial and cultural centre of Malwa. In the era of the sixteen Mahajanapadas, the great kingdoms of early historic India, Avanti was among the most powerful.

Archaeology shows what that city looked like. The ancient walled settlement lay around the Garh Kalika hill beside the river, enclosed by a high mud rampart and a broad moat. Excavated layers yield iron tools, burnt-brick structures and fine burnished pottery. The finest ware of the age, Northern Black Polished Ware, came to the northern Deccan from the Gangetic plains by way of Ujjain.

Trade was the city's lifeblood. Ujjain sat on the main route from Mathura through Mahishmati (Maheshwar) on the Narmada to Paithan on the Godavari, and onward to the ports of the western coast. The Periplus of the Erythraean Sea, written by a Greek merchant in the first century CE, describes a city called Ozene inland from Barygaza (Bharuch). It sent onyx, fine muslin, ordinary cottons and aromatics down to the coast for export.

The Mauryas and Ashoka at Ujjain

In the fourth century BCE, Chandragupta Maurya brought Avanti into his empire. Under the Mauryas, Ujjain became the capital of the western province, one of the four provinces named in the edicts of Chandragupta's grandson, Ashoka.

Ashoka himself knew the city well. During the reign of his father Bindusara, he served as viceroy at Ujjain, a post that shows how much the city mattered. Here he married Devi, the daughter of a merchant from Vidisha. Sri Lankan Buddhist tradition holds that their children, Mahendra and Sanghamitra, who later carried Buddhism to Sri Lanka, were born at Ujjain.

The Mauryan levels at Ujjain have produced copper coins, terracotta ring wells and ivory seals inscribed in Brahmi. After the Mauryas, the city passed through the hands of the Shungas, the Satavahanas and the Western Satraps, who fought over this rich crossroads for generations. Through all these changes it remained a centre of learning for Hindu, Jain and Buddhist communities alike.

Vikramaditya: legend, history and the Vikram Samvat

No figure looms larger over Ujjain's imagination than King Vikramaditya. In story after story, from the Vetala tales to the Simhasana Battisi, he is the ideal king of Ujjayini: brave, just and generous, a patron of poets and a devotee of the goddess Harsiddhi. The district administration still describes Harsiddhi as Vikramaditya's family deity.

Legend also credits him with founding the Vikram Samvat, the era that many Hindus still use for religious dates. A Jain account, the Kalakacharya Kathanaka, tells how the Shakas overthrew King Gandharvasena of Ujjain, and how his son Vikramaditya later drove them out and began a new era to mark the victory. The era's epoch is 57 BCE, so Vikram Samvat years run about 57 years ahead of the Common Era.

Historians are more cautious. The era beginning in 57 BCE is found in early inscriptions under other names, such as Krita and the era of the Malavas. It is first called 'Vikrama' in an inscription of 842 CE, and the link with a king named Vikramaditya appears later still. Scholars have proposed several historical candidates, among them the Gupta emperor Chandragupta II, who took the title Vikramaditya. The Vikramaditya of Ujjain is therefore best understood as a figure of legend who may combine memories of more than one king. That takes nothing away from his place in the city's identity.

Kalidasa and the literary city

Ujjain was a lively city under the Guptas in the fourth and fifth centuries, and its literary reputation owes most to Kalidasa. The greatest of Sanskrit poets refers to the city again and again and seems to have lived there for at least part of his life. Tradition, inevitably, places him at the court of Vikramaditya.

His love for the city is clearest in the Meghaduta, the 'Cloud Messenger'. An exiled yaksha asks a rain cloud to carry a message to his beloved in the Himalayas, and urges it not to miss Ujjayini on the way. The verses that follow describe the city's mansions, its women, the evening worship at Mahakal and the breezes off the Shipra. They are among the most admired passages in Sanskrit poetry, and the poet seems reluctant to let the cloud move on.

Kalidasa was not alone. The plays of Bhasa are set in Ujjain, as is Shudraka's Mrichchhakatika (The Little Clay Cart), a drama of merchants, courtesans and politics in a bustling city. The district's own list of scholars associated with Ujjain includes Varahamihira, Banabhatta, Rajashekhara and Bhartrihari, the poet-king who, by tradition, renounced his throne here. The memory lives on in the annual Kalidas Samaroh, held in Ujjain since 1958 and organised by the state's Kalidasa Akademi.

The prime meridian of Indian astronomy and the Vedh Shala

Ujjain had a special place in the mathematics of time. In the Indian astronomical tradition, the first meridian of longitude was taken to pass through Ujjain, much as Greenwich serves the modern world, and calculations of planetary positions were reckoned from it. The city also lies close to the Tropic of Cancer, a fact marked by the Kark Raj temple on the Shipra. The district administration calls Ujjain the place that gave India its system for calculating time.

The astronomer Varahamihira, author of the Pancha-Siddhantika and the Brihat Samhita, is closely associated with the city. Its astronomical tradition was strong enough that, more than a thousand years later, a Rajput prince chose it for one of his observatories.

That prince was Maharaja Sawai Jai Singh II of Amber, founder of Jaipur and a serious astronomer. While serving as governor of Malwa, he built the Vedh Shala, also called the Jantar Mantar, on the bank of the Shipra. The district administration dates it to 1719; other sources give 1725. It was one of five observatories he commissioned, the others being at Jaipur, Delhi, Mathura and Varanasi. The original instruments, the Samrat Yantra, Nadivalaya Yantra, Bhitti Yantra and Digamsha Yantra, were built in masonry for naked-eye observation, and a Shanku Yantra was added later. The Vedh Shala is still in use: local solar time is read and converted to standard time, and the observatory has published an annual panchang, the Hindu almanac, since 1942.

The Paramaras, the Sultanates and the Mughals

From the ninth century the Paramaras became the dominant power in Malwa. Independent Paramara rule began in the tenth century under Siyaka II. The dynasty became so closely identified with Ujjain that later tradition turned Vikramaditya himself into a Paramara. The great tank near Mahakal is attributed to the Paramara period. In time the Paramaras made Dhar their capital, and Bhoja, the most celebrated king of the line, ruled from there.

The centuries that followed were harder. Mahmud of Ghazni forced the city to pay tribute, and in the 1230s Iltutmish of the Delhi Sultanate sacked Ujjain and despoiled its temples, the Mahakal shrine among them. Under the Sultans of Malwa the city became a provincial centre. The Kaliadeh palace on an island in the Shipra dates from this period, and an inscription records building there in 1458.

Mughal rule brought recovery. After Akbar ended Baz Bahadur's hold on Malwa, he had a wall built around Ujjain with gates, including the Nadi, Kaliadeh, Sati, Dewas and Indore Darwazas. In 1658 the succession war between Shah Jahan's sons reached the city: Aurangzeb and Murad defeated Maharaja Jaswant Singh of Jodhpur at Dharmatpura near Ujjain. The district's own history notes that Aurangzeb also made grants to Ujjain's temples, and that priestly families preserve these documents to this day.

The Maratha city and the Scindias

The Ujjain that visitors see today is largely a Maratha creation. As Maratha power spread across Malwa in the early eighteenth century, the city came under the Scindia (Shinde) family. Most accounts date Ranoji Scindia's capital at Ujjain to the 1730s, while the district administration places the final passing of Ujjain to the Scindias in 1750. It remained their chief town until 1810, when Daulat Rao Scindia moved his capital to Gwalior.

The Maratha period was a cultural renaissance. Ruined temples were restored and new ones built. The present Mahakaleshwar temple, along with most of the city's temples, belongs to this period. Ujjain became a meeting point of painting styles. Maratha-style murals survive in the Ram Janardan, Kal Bhairav, Kalpeshwar and Tilakeshwar temples, while the older Malwa idiom appears at Sandipani Ashram and in the havelis of the city's merchant families. Wood-carving flourished too, in carved galleries and balconies, though much of it has since been lost.

After the capital moved to Gwalior, Ujjain's commercial importance declined. The British preferred to build up Indore, but the Ujjain–Ratlam–Godhra railway restored some of the city's trade in cotton, grain and opium. After independence, Ujjain became part of Madhya Bharat, which merged into Madhya Pradesh in 1956.

A city of many faiths and traditions

Ujjain is one of the Sapta Puri, the seven cities that tradition holds can grant liberation (moksha), alongside Ayodhya, Mathura, Haridwar, Varanasi, Kanchi and Dwarka. It is home to Shri Mahakaleshwar, one of the twelve Jyotirlingas, whose lingam is revered as swayambhu (self-manifested) and faces south. This feature is held to be unique among the Jyotirlingas. Ujjain also hosts Harsiddhi and Gadkalika, both venerated as seats of the goddess, and every twelve years it hosts the Simhastha, its Kumbh, on the Shipra.

The sacred map of the city is crowded. The Avanti Khanda of the Skanda Purana speaks of 84 Mahadevas, 64 Yoginis, 8 Bhairavas and 6 Vinayakas in Ujjain. It also describes Mangalnath as the birthplace of the planet Mars. Tradition holds that Krishna and Balarama studied at the ashram of the sage Sandipani here, and that Rama performed his father's last rites at the spot now called Ram Ghat. These are articles of faith rather than history, but they shape how millions experience the city.

Ujjain has never belonged to one tradition alone. Shaivas, Vaishnavas and Shaktas all have major shrines here. The Siddha and Natha traditions flourished, with Bhartrihari linked to the Nath lineage of Guru Gorakhnath. Jain and Buddhist communities have been part of the city's life since the days of Ashoka. That layered, open religious culture is perhaps Ujjain's most lasting inheritance.

Good to know

Ujjain history: frequently asked questions

What was Ujjain called in ancient times?

Ujjain was known as Avantika and Ujjayini, among other names. It was the capital of Avanti, one of the sixteen Mahajanapadas of early India.

Did Ashoka live in Ujjain?

Yes. Ashoka served as viceroy at Ujjain during his father Bindusara's reign, and Ujjain was the capital of the Mauryan western province.

Was King Vikramaditya a real person?

Vikramaditya of Ujjain is a figure of legend. Historians have linked him to several real kings, including the Gupta emperor Chandragupta II, but there is no consensus. The Vikram Samvat era begins in 57 BCE, but it was called by other names until the 9th century.

Why is Ujjain called the Greenwich of India?

In the Indian astronomical tradition, the first meridian of longitude was taken to pass through Ujjain, so time and planetary positions were reckoned from it.

Who built the Vedh Shala in Ujjain?

Maharaja Sawai Jai Singh II built the Vedh Shala (Jantar Mantar) while he was governor of Malwa. The Ujjain district administration dates it to 1719; other sources give 1725. It is one of five observatories he commissioned.

When did the Scindias rule Ujjain?

Ujjain came under the Scindias in the 18th century and remained their chief town until 1810, when Daulat Rao Scindia moved his capital to Gwalior.