Delhi has a long history, and has been an important political centre of India as the capital of several empires. Earliest coverage of Delhi's history is in the onset of the Tomar's kingdom in the 8th century. It is considered to be a city built, destroyed and rebuilt several times, as outsiders who successfully invaded the Indian Subcontinent would ransack the existing capital city in Delhi, and those who came to conquer and stay would be so impressed by the city's strategic location as to make it their capital and rebuild it in their own way. In the medieval era, Delhi was ruled by the Tomara dynasty and Chauhan from 736 to 1193. The Delhi Sultanate is the name given for a series of five successive dynasties, which remained as a dominant power of Indian subcontinent with Delhi as their capital. During Sultanate period, the city became a center for culture. The Delhi Sultanate came to an end in 1526, when Babur defeated the forces of the last Lodi sultan, Ibrahim Lodi at the first Battle of Panipat, and formed the Mughal Empire. The Mughals ruled the area for three centuries. During the 16th century, the city declined as the Mughal capital was shifted. The fifth Mughal Emperor Shah Jahan built the walled city of Shahjahanabad within Delhi, and its landmarks, the Red Fort and Jama Masjid. His reign would be considered the zenith of the empire. After the death of his successor Aurangzeb, the Mughal Empire was plagued by a series of revolts. They lost major portions to the Marathas, Sikhs and many governors of erstwhile Mughal provinces like Bengal, Awadh and Hyderabad. Delhi was sacked and looted by Nader Shah. The Jats captured many important towns of Mughal heartland south of Delhi. The Marathas captured Delhi in the battle of Delhi in 1757 and continued to control it until 1803 when they were defeated by the British during the second Anglo-Maratha War. In 1803, Delhi was captured by the British East India Company. During Company Rule in India, the Mughal Emperor Bahadur Shah II was reduced to merely a figurehead. The Indian Rebellion of 1857 sought to end company rule and declared Bahadur Shah II the Emperor of India. However, the British soon recaptured Delhi and their other territories, ending the short-lived rebellion. This also marked the beginning of direct British Rule in India. In 1911, the capital