of Maharashtra to the south, during the 2nd millennium BCE. Ujjain, also known historically as Ujjaiyini and Avanti, emerged as the first major centre in the Malwa region during India's second wave of urbanisation in the 7th century BC (the first wave was the Indus Valley Civilization). Around 600 BC an earthen rampart was built around Ujjain, enclosing a city of considerable size. Ujjain was the capital city of the Avanti kingdom, one of the prominent mahajanapadas of ancient India. In the post-Mahabharata period—around 500 BC—Avanti was an important kingdom in western India; it was ruled by the Haihayas, a people who were responsible for the destruction of Naga power in western India. The region was conquered by the Nanda Empire in the mid-4th century BC, and subsequently became part of the Maurya Empire. Ashoka, who was later a Mauryan emperor, was governor of Ujjain in his youth. After the death of Ashoka in 232 BC, the Maurya Empire began to collapse. Although evidence is sparse, Malwa was probably ruled by the Kushanas, the Shakas and the Satavahana dynasty during the 1st and 2nd century CE. Ownership of the region was the subject of dispute between the Western Kshatrapas and the Satavahanas during the first three centuries AD. Ujjain emerged a major trading centre during the 1st century AD. Malwa became part of the Gupta Empire during the reign of Chandragupta II (375–413), also known as Vikramaditya, who conquered the region, driving out the Western Kshatrapas. The Gupta period is widely regarded as a golden age in the history of Malwa, when Ujjain served as the empire's western capital. The astronomer Varahamihira was based in Ujjain, which emerged as a major centre of learning, especially in astronomy and mathematics. Around 500, Malwa re-emerged from the dissolving Gupta Empire as a separate kingdom; in 528, Yasodharman of Malwa defeated the Hunas, who had invaded India from the north-west. During the seventh century, the region became part of Harsha's empire, who disputed the region with the Chalukya king Pulakesin II of Badami in the Deccan. In 756 AD Gurjara-Pratiharas advanced into Malwa. In 786 the region was captured by the Rashtrakuta kings of the Deccan, and was disputed between the Rashtrakutas and the Gurjara Pratihara kings of Kannauj until the early part of the tenth century. The Emperors of the Rashtrakuta dynasty appointed the Paramara rulers as governors of Malwa. From the