The History of Ahmedabad begins in the eleventh century with the Solanki King Karandev I, ruler of Anhilwara (modern Patan). He waged a war against the Bhil King Ashapall or Ashaval, and after his victory established a city called Karnavati on the banks of the Sabarmati at site of modern Ahmedabad. Solanki rule lasted until the thirteenth century, when Gujarat came under the control of the Vaghela dynasty of Dwarka. Gujarat was conquered by the Sultanate of Delhi at the end of the thirteenth century. In 1411 , the rule of the Muzaffarid dynasty was established in Gujarat. According to tradition, Sultan Ahmed Shah, while camping on the banks of the River Sabarmati, saw a hare chasing a dog. Impressed by this act of bravery, the Sultan, who had been looking for a place to build his new capital, decided to locate the capital here and called it Ahmedabad .
In 1487, Mahmud Begada, the grandson of Ahmed Shah, fortified the city with an outer wall 10 km (6 miles) in circumference and consisting of twelve gates, 189 bastions and over 6,000 battlements. Ahmedabad was ruled by the Muzaffarid dynasty until 1573 when Muzaffar II was the Sultan of Ahmedabad. Gujarat was then conquered by the Mughal emperor Akbar in 1573. During the Mughal reign, Ahmedabad became one of the Empire's thriving centres of trade, mainly in textiles, which were exported to as far as Europe. The Mughal ruler Shahjahan spent the prime of his life in the city, sponsoring the construction of the Moti Shahi Mahal in Shahibaug. The armies of the Maratha generals Raghunath Rao and Damaji Gaekwad captured the city and ended Mughal rule in Ahmedabad.
A famine in 1630 and the constant conflicts between the Peshwa and the Gaekwad armies virtually destroyed many parts of the city, causing its population to flee. The British East India Company took over the city in 1818 as a part of the conquest of India. A military cantonment was established in 1824 and a municipal government in 1858. In 1864, a railway link between Ahmedabad and Mumbai (then Bombay) was established by the Bombay, Baroda, and Central India Railway (BB&CI), making Ahmedabad an important junction in the traffic and trade between northern and southern India.
Large numbers of people migrated from rural areas to work in textile mills, establishing a robust industry. The Indian independence movement developed strong roots in the city when, in 1915, Mahatma Gandhi established two ashrams — the Kochrab Ashram near Paldi in 1915 and the Satyagraha Ashram on the banks of the Sabarmati in 1917 — that would become centres of intense nationalist activities. During the mass protests against the Rowlatt Act in 1919, textile workers burned down 51 government buildings across the city in protest at a British attempt to extend wartime regulations after the First World War. In the 1920s, textile workers and teachers went on strike, demanding civil rights and better pay and working conditions. In 1930, Gandhi initiated the Salt Satyagraha from Ahmedabad by embarking from his ashram on the famous Dandi Salt March. The city administration and economic institutions were rendered functionless by the large masses of people who took to the streets in peaceful protests in the early 1930s, and again in 1942 during the Quit India movement.
Following independence and the partition of India in 1947, the city was scarred by intense communal violence that broke out between Hindus and Muslims. Ahmedabad became the capital of the new state of Gujarat after the bifurcation of the State of Bombay on 1 May 1960. During that period, a large number of educational and research institutions were founded in the city, making it a major centre of higher education, science and technology. Ahmedabad's economic base was diversified with the establishment of heavy and chemical industries in its vicinity around the same period. But the growth in the next two decades was punctuated by political events in and around the city. In February 1974, Ahmedabad occupied the centre stage in national politics with the launch of the Nav Nirman agitation — a protest against a 20% hike in the hostel food fees at the L.D. College of Engineering that snowballed into a mass agitation to remove Chimanbhai Patel, then-chief minister of Gujarat, on charges of corruption. In the 1980s, a reservation policy was introduced in the country, which led to anti-reservation protests in 1981 and 1985.
The protests witnessed violent clashes between people belonging to various castes. On 26 January 2001 a devastating earthquake struck the city, centred near Bhuj, measuring 6.9 on the Richter scale. As many as 50 multistory buildings collapsed, killing 752 people and devastating the city's infrastructure. In recent years, the effects of globalisation and the liberalisation of the Indian economy has energised the city's economy. The city has witnessed the establishment of scientific and service industries, the expansion of the information technology sector, and significant improvements in transportation and communications. Ahmedabad's population is growing, which has resulted in a construction and housing boom. However, this has challenged the city's infrastructure and power supply.