The area was attacked by Mahmud Ghaznavi, Timur in 1368. Guru Ram Rai, the errant eldest son of the seventh Guru of the Sikhs, Guru Har Rai, established his 'Dera' (camp) in the Dun Doon Valley around 1676 and the town that grew around this 'Dera' has come to be known as 'Dehradun'. He founded his own Udasi Panth (sect) and received support from Aurangzeb. Rohilla chieftain Najib ad-Dawlah in 1757 and Ghulam Qadir in 1785. This kept the area in disarray till 1801. The British captured the area in 1816 and founded the cities of Landour and Mussourie in 1827–28. The district was added to the Garhwal division in the 1970s. It was established as the capital of Uttarakhand after the establishment of the state as Uttaranchal in the year 2000.