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 in China between 1774 and 1798.