The history of Delhi is, in many ways, the history of India. Popular Hindu mythology claims that Delhi was the site of the fabled city of Indraprastha, which featured in the Mahabharata over 3000 years ago, but historical evidence suggests that the area has been settled for around 2500 years. Since the 12th century, Delhi has seen the rise and fall of seven major powers. The Chauhans took control in the 12th century and made Delhi the most important Hindu centre in northern India. When Qutab-ud-din Aibak occupied the city in 1193, he ushered in six and a half centuries of Muslim rule. The Delhi Sultanate lasted from 1206 to 1526, despite its inconsistent rule, and was followed by the mighty Mughals from 1526 to 1857. The basis of what is today Old Delhi, including the Red Fort and the Jama Masjid, was built during the reign of the Mughal emperor Shah Jahan (1628-1658). In 1803, the British captured Delhi and installed a British administrator. Delhi was not the capital of India at the time, but it was an important commercial centre and had a population of 150,000 by the start of the 20th century. It is from here that the mughals spread their roots and this is also where the British ruled India from. Belief has it that Delhi was the capital city of the Kingdom of the Pandavas, the heroes of the Mahabharata . The earliest known settlement in the Delhi area, thought to have stood close to the River Yamuna (near the Purana Qila) between 1000 BC and the fourth century AD, has been identified with the city of Indraprastha, mentioned in the Mahabharata . Unearthed terracotta pots, coins and jewellery show that Delhi lay on an important trunk route of the Mauryan period, and Ptolemy, who came here in the second century AD, mentions "Dilli".
However, modern Delhi is usually said to have come into being when the Tomara Rajputs founded Lal Kot in 736 AD. In 1180, a rival Rajput clan, the Chauhans, ousted the Tomaras and renamed the walled citadel Qila Rai Pithora, the first city of Delhi. Only a few walls of Lal Kot now remain, in the Mehrauli suburb of southwest Delhi, but a stone inscription at the Qutb Minar nearby claims that the stones of the numerous Hindu and Jain temples constructed in Lal Kot were later used to build the Great Mosque in the Qutb complex. Soon afterwards, in the two successive battles of Tarain in 1191, the Rajputs first managed to hold off an invading force from Afghanistan led by Muhammad Ghuri, and then succumbed to it a few months later.
Unlike other invaders from Central Asia who swept into the north Indian plains, Muhammad Ghuri had come to stay and not merely to plunder. He was assassinated in 1206 and his kingdom did not survive long in Afghanistan, but his Indian provinces, palaces and forts remained more or less intact in the hands of his Turkish general, Qutb-ud-din Aibak. This ex-slave, who founded the Delhi Sultanate (or Slave Dynasty - the first major Muslim rulers of the subcontinent), established himself at the site of Lal Kot, and commenced the construction of the Qutb Minar. His successor, Iltutmish (1211-27), was arguably the greatest of the early Delhi sultans.
In 1290, another group of Turks came to power - the Khaljis. Inspired by Ala-ud-din Khalji (1296-1316), they extended their dominion to the Deccan plateau of central India. His reign, the pinnacle of the Delhi Sultanate, was marked by agrarian reforms, and the establishment in 1303 of Siri, the second city of Delhi, built in characteristically ornate marble and red sandstone. Near present-day Hauz Khas, it grew into a flourishing commercial centre. Ala-ud-din died a disappointed man, however, as cracks appeared in his dream of empire; the ensuing period of confusion only ended when Ghiyas-ud-din Tughluq proclaimed himself Sultan in 1320.
Ghiyas-ud-din in turn built a city fortress, at Tughluqabad, 8km east of Qutb, but Delhi's third city was occupied for just five years from 1321, when the capital was shifted 1100km south to Daulatabad in Maharashtra at great human cost. Apart from the ramparts encompassing the crumbling ruins, and the odd building and tomb, little now remains of this third settlement. Water scarcity drove the Tughluqs back to Delhi in 1327, and as a recompense for the mistake, a new city, Jahanpanah, was built between Lal Kot and Siri by the eccentric Muhammad bin Tughluq to protect the vulnerable open plain. The energies of the next sultan, Firuz Shah, were taken up with suppressing rebellion, as the Sultanate began to disintegrate, but his reputation as an iconoclast is belied by his keen interest in Indian culture and history. Fascinated by the Ashokan pillars of Meerut and Topra, he had them moved to the new capital, the fifth city of Firozabad, built beside the river in 1354.
The Tughluq line came to an end in 1398, when Timur (Tamerlane), a Central Asian Turk, sacked Delhi. His successors, the Sayyids (1414-44), were ousted by Buhlul Lodi who established a dynasty that left behind the fine tombs and mosques still to be seen in the beautiful Lodi Gardens. As the Lodi sultans became more absolute, they made many enemies among the nobles, especially the governors of Punjab and Sind, who invited Babur (a descendant of Genghis Khan) and Timur, who was seeking his fortune in Afghanistan, to come to their aid. The Lodi dynasty ended when Sultan Ibrahim Lodi died in battle, fighting the brilliant and enigmatic Babur on the plain of Panipat just north of Delhi in 1526. Babur's victory marked the dawn of the Mughal (a derivative of Mongol) dynasty, whose lengthy sojourn in power led to the eventual realization of the dream of an Indian empire that had so eluded the earlier Delhi Sultans. Babur's reign was brief, and he moved his capital to Agra not long after taking Delhi; his Babarnama , a chronicle of the times, makes fascinating reading.
Babur was succeeded in 1530 by his son, Humayun, a scholar and astronomer who moved to Delhi in 1534. All the signs indicated that Humayun's reign would be prosperous, but in 1540, he was driven to Persia for fifteen years by the Afghan King Sher Shah of Ser, who quickly built the fort, Din-Panah, or Asylum of Faith, which still stands on the banks of the Yamuna in the southwest of modern Delhi and is known as Purana Qila. Sher Shah was surrounded by bickering power-thirsty relatives, all of whom were overcome when Humayun returned from Kabul to retake Delhi in 1555. When Humayun died in a fall in 1556, his wife Banu Begum built a sandstone garden tomb for him in Nizamuddin, in the style that was to set the pattern for the development of Mughal mausoleum architecture. His son Akbar (who could not read or write) took over as emperor, and the capital was moved once more to Agra.
Delhi once again became capital under Prince Khurrum, Akbar's grandson, in 1628, who assumed the title Shah Jahan, "Ruler of the Universe", and began a fruitful and extravagant reign that oversaw the construction of some of the finest Mughal monuments, including the Taj Mahal in Agra. The new walled capital of Shahjahanabad, the seventh city, which is now Old Delhi, incorporated the mighty Red Fort with its opulent courts and the huge Jama Masjid or Friday Mosque, fringed by bazaars. Shah Jahan was deposed(and imprisoned in Agra) by his ruthless son, Aurangzeb, who ruled from Delhi until 1681, when he transferred the capital to the Deccan plateau until his death in 1707.
For the next sixty years, Delhi's government was controlled by courtiers, and the city fell victim to successive invasions. In 1739, Nadir Shah, the emperor of Persia, swept across north India and overcame Muhammad Shah in the Red Fort, taking away precious booty and wiping out much of the local population. The relatively plain tomb of Safdarjung (near the Lodi Gardens), built in 1754 for Emperor Mirza Khan in the same style as the Taj, yet lacking the marble and rich decoration, demonstrates the decline of Mughal power. Soon after, in 1760, the Hindu Marathas and Jats, in the wake of fading Mughal supremacy, combined forces against the rulers and besieged and looted the Red Fort, but did not take power.
The Mughal rulers were reduced to puppet kings, and the British, who had already gained footholds in Madras and Bengal under the guise of the East India Company, moved to Delhi in 1803 during the reign of the Mughal emperor, Bahadur Shah. They swiftly took control, leaving Bahadur Shah with his palace and his pension, but no power. British forces fended off a number of Maratha attacks in the next decade, and faced determined opposition during 1857 when the Indian Mutiny (or "First War of Independence") broke out. Bahadur Shah was proclaimed Hindustani emperor in the Red Fort, and it took much bloodshed before the British regained the city.
The British retained a hold on Delhi while administering affairs of state from their capital in Calcutta. When King George V came to India from England to be crowned as emperor in 1911, it was decided to make Delhi India's new capital . Fervent construction of sprawling bungalows, parliamentary buildings and public offices followed, and in 1931 Delhi was officially inaugurated as the capital of Britain's largest colonial possession.
With India's declaration of Independence in 1947, the British, represented in Delhi by the viceroy, Lord Mountbatten, lost all authority, and the democratically elected Congress government came to power with Nehru at its head. Independence saw a mass migration of Muslims from Delhi to newly created Pakistan, taking with them a cultural ambience that the subsequent influx of Punjabis have failed to replace. Today, Delhi is one of the fastest growing cities in the world, with spiralling population growth and pollution to match.