Kapurthala State, with its capital at Kapurthala, was a former Princely state of the Punjab Province of India. Ruled by Ahluwalia Sikh rulers, spread across . According to the 1901 census the state had a population of 314,341 and contained two towns and 167 villages. In 1930, Kapurthala became part of the Punjab States Agency and acceded to the Union of India in 1947. In colonial India, Kapurthala State was known for its communal harmony, with its Sikh ruler Jagatjit Singh building the Moorish Mosque for his Muslim subjects. At the time of the Indian independence movement, the ruler of the Kapurthala State opposed the partition of India and advocated for a united, secular country. The ruling dynasty of Kapurthala originated in the Ahluwalia misl. According to this account, Krishna's descendant Gaj built the fort of Gajni, and lost his life in a battle against a joint Roman-Khorasani army. His son Salibahan established the city of Sialkot, and started the Shak era after defeating the Shaks in 78 CE. After the Muslim conquest of Punjab, his descendants migrated to the Jaisalmer area, where they came to be known as Bhatti Rajput tribe. After Alauddin Khalji's conquest of Jaisalmer, some of the Bhatti tribe people's migrated to Tarn Taran district, mingled with Jats. Gradually, they came to be known as Jats, and in the 17th century, they joined Guru Hargobind's army. Ganda Singh of this family raided Lahore, whose governor Dilawar Khan persuaded him to join the Lahore army, and assigned him the fief of Ahlu and some other villages. Ganda Singh's son Sadhu (or Sadho) Singh lived in Ahlu, because of which the family came to be known as Ahluwalia. Sadhu Singh and his four sons married into Kalal families, because of which the family came to be known as Ahluwalia. The descendants of Sadhu Singh son Gopal Singh (who was the grandfather of Jassa Singh) established the royal family of Kapurthala. The British administrator Lepel Griffin (1873) dismissed this account as spurious.