Delhi were inhabited continuously from 2nd millennium BC to 6th century BC. It is said that the city was previously Indraprastha, the capital of Pandavas, mentioned in Mahabharata. Maurya period, 300BC was followed by setting up of Lal Kot city by Tomara Dynastiy in AD 736. In 1180, the Chauhans invaded this city and named it Qila Rai Pithora. In 1192, king Prithviraj Chauhan was overpowered by the Afghan troops lead by Muhhamad Ghori. The rule of Muslims continued till 1206, after which, the Turkic general Qutb-ud-din Aibak became the first Sultan of Delhi. The Mamluk Sultanate was defeate by Khilji dynasty that ruled from 1290 to 1388. This was succeeded by Timur Lenk rule, Sayyid dynasty, Lodhi dynasty and finally, Mughal rule till 1752. The Marathas consequently took power and after a series of ups and downs, it continued to reign till 1803. Lastly, the British East India Company ruled Delhi till independence.