Northwest India borders Pakistan to the west, and the Tibet Autonomous Region and Xinjiang of China to the northeast.In the late eighteenth and early nineteenth centuries, the Punjab region was ruled by Sikh Misls.The Rajputs ruled the Thar region and occasionally the upper plains from the mediaeval era till the formation of the Indian Union (1947).In 185 BC, Demetrius I, the son of the King of Bactria, conquered the western part of the Magadhan Empire and established the Indo-Greek Kingdom.Indo-Scythians, in modern-day Afghanistan, Balochistan and Sindh, warred with the Indo-Greeks eventually captured all of their strongholds except the one at Sagala.In middle Ganga plain, the Kingdom of Panchala regained its independence from the collapsing Magadhan Empire in 107 BC.In AD 19, the Governor of Sakastan in the Parthian Empire to the west declared independence and established the Indo-Parthian Kingdom.[15] The Kushan Empire expanded further into the Gangetic plain and made the Kingdom of Panchala its tributary state for a brief period until early third century when it lost controlled over northwest India.The remaining eastern part of the Magadhan Empire collapsed and broke into multiple small kingdoms in the late sixth century.However the empire collapsed in 1206 and the Indian territories were consolidated by his general Qutub-ud-din Aibak, who proclaimed himself the Sultan of Delhi in 1206.The Delhi Sultanate defeated the invading Mongol Empire and saved India from the destruction that had met Central and Western Asia.Following this, he defeated the Rajput Confederation and proclaimed himself the King of Hindustan and founded the House of Babur (Mughal dynasty).In 1556, Akbar the Great was crowned Emperor of Hindustan amid a civil war against the House of Sur in the Hindustani Empire.The East India Company controlled the British territories within the Hindustani Empire and nominally functioned under the authority of the Shahenshah of Hindustan.In 1835, the East India Company stopped recognising the authority of the Shahenshah of Hindustan, at that time Akbar II, and downgraded him to King of Delhi.The Shahenshah declared war against the East India Company and wrote letters to the various kingdoms and principalities of the erstwhile empire.In many states that supported the company, the troops rebelled and acquired control, and joined the war nonetheless.The United Kingdom got involved in this war after the East India Company suffered initial defeats.