section_path: History/Early history
section_name: Early history
paragraph_text: Early history
  
  The area around Ahmedabad has been inhabited since the 11th century, when it was known as Ashaval. At that time, Karna, the Chaulukya (Solanki) ruler of Anhilwara (modern Patan), waged a successful war against the Bhil king of Ashaval, and established a city called Karnavati on the banks of the Sabarmati. Solanki rule lasted until the 13th century, when Gujarat came under the control of the Vaghela dynasty of Dholka. Gujarat subsequently came under the control of the Delhi Sultanate in the 14th century. However, by the earlier 15th century, the local Muslim governor Zafar Khan Muzaffar established his independence from the Delhi Sultanate and crowned himself Sultan of Gujarat as Muzaffar Shah I, thereby founding the Muzaffarid dynasty. In 1411, the area came under the control of his grandson, Sultan Ahmed Shah, who selected the forested area along the banks of the Sabarmati river for his new capital. He laid the foundation of a new walled city near Karnavati and named it Ahmedabad after himself. According to other versions, he named the city after four Muslim saints in the area who all had the name Ahmed. Ahmed Shah I laid the foundation of the city on 26 February 1411 (at 1.20 pm, Thursday, the second day of Dhu al-Qi'dah, Hijri year 813) at Manek Burj. Manek Burj is named after the legendary 15th-century Hindu saint, Maneknath, who intervened to help Ahmed Shah I build Bhadra Fort in 1411. Ahmed Shah I chose it as the new capital on 4 March 1411. Chandan and Rajesh Nath, 13th generation descendants of Saint Maneknath, perform puja and hoist the flag on Manek Burj on Ahmedabad's foundation day and for the Vijayadashami festival every year.
  
  In 1487, Mahmud Begada, the grandson of Ahmed Shah, fortified the city with an outer wall 10 km (6.2 mi) in circumference and consisting of twelve gates, 189 bastions, and over 6,000 battlements. In 1535 Humayun briefly occupied Ahmedabad after capturing Champaner when the ruler of Gujarat, Bahadur Shah, fled to Diu. Ahmedabad was then reoccupied by the Muzaffarid dynasty until 1573 when Gujarat was conquered by the Mughal emperor Akbar. During the Mughal reign, Ahmedabad became one of the Empire's thriving centres of trade, mainly in textiles, which were exported as far as Europe. The Mughal ruler Shah Jahan spent the prime of his life in the city, sponsoring the construction of the Moti Shahi Mahal in Shahibaug. The Deccan Famine of 1630–32 affected the city, as did famines in 1650 and 1686. Ahmedabad remained the provincial headquarters of the Mughals until 1758, when they surrendered the city to the Marathas.