The Khanate of Kokand (; Khānneshin-e Khoqand, Khoqand Khānligi) was a Central Asian polity in the Fergana Valley centred on the city of Kokand between 1709 and 1876. Its territory is today divided between Uzbekistan, Kyrgyzstan, Tajikistan, and Kazakhstan. History The Khanate of Kokand was established in 1709 when the Shaybanid emir Shahrukh, of the Ming Tribe of Uzbeks, declared independence from the Khanate of Bukhara, establishing a state in the eastern part of the Fergana Valley. He built a citadel as his capital in the small town of Kokand, thus starting the Khanate of Kokand. His son, Abdul Kahrim Bey, and grandson, Narbuta Bey, enlarged the citadel, but both were forced to submit as a protectorate, and pay tribute to, the Qing dynasty between 1774 and 1798. Narbuta Bey’s son Alim was both ruthless and efficient. He hired a mercenary army of Ghalcha highlanders, and conquered the western half of the Fergana Valley, including Khujand and Tashkent. He was assassinated by his brother Umar in 1811. Umar's son, Mohammed Ali (Madali Khan), ascended to the throne in 1822 at the age of 12. During his reign, the Khanate of Kokand reached its greatest territorial extent. The Kokand Khanate also housed the Khojas of Kashgar like Jahangir Khoja. In 1841, the British officer Captain Arthur Conolly failed to persuade the various khanates to put aside their differences, in an attempt to counter the growing penetration of the Russian Empire into the area. In November 1841, Captain Conolly left Kokand for Bukhara in an ill-fated attempt to rescue fellow officer Colonel Charles Stoddart, and both were executed on 24 June 1842 by the order of Emir Nasrullah Khan of Bukhara. Following this, Madali Khan, who had received Conolly in Kokand, and who had also sought an alliance with Russia, lost the trust of Nasrullah. The Emir, encouraged by the conspiratorial efforts of several influential figures in Kokand (including the commander in chief of its army), invaded the Khanate in 1842. Shortly thereafter he executed Madali Khan, his brother, and Omar Khan's widow, the famed poet Nodira. Madali Khan's cousin, Shir Ali, was installed as the Khan of Kokand in June 1842. Over the next two decades, the khanate was weakened by a bitter civil war, which was further exacerbated by Bukharan and Russian incursions. During this period, the Kyrgyz tribes also broke away, forming the under the leadership of Ormon Khan.