Meanwhile, Ali Muhammad Khan (1737–1749), grandson of Shah Alam, captured the city of Bareilly and made it his capital, later uniting the Rohillas to form the state of 'Rohilkhand', between 1707 and 1720, making Bareilly his capital. He rapidly rose to power and got confirmed in possession of the lands he had seized. The Emperor made him a Nawab in 1737, and he was recognised as the governor of Rohilkhand in 1740. According to 1901 census of India, the total Pathan population in Bareilly District was 40,779, out of a total population of 1,090,117. Their principal clans were the Yusafzais, Ghoris, Lodis, Ghilzai, Barech, Marwat, Durrani, Tanoli, Tarin, Kakar, Khattak, Afridi and Baqarzai. Other important cities were Rampur, Shahjahanpur, Badaun, and others.