Sayid Muhammad Khudayar Khan, usually abbreviated to Khudayar Khan, was a Khan of Kokand who reigned between 1845 and 1875 with interruptions. He was the son of Shir Ali Khan. During the reign of Khudayar Khan, the Khanate was suffering from a civil war and from interventions of the Emir of Bukhara. Subsequently, the Russian invasion into the Central Asia first forced the Khanate to become a vassal of the Russian Empire, and in 1876 the Khanate was abolished as a result of the suppression of an uprising. In 1875, Khudayar Khan, who took pro-Russian position, during the uprising had to flee to Orenburg in Russia. He died in exile.
In 1845, Shir Ali Khan was killed during the uprising. His son Murad Beg Khan was declared the khan briefly, however, he was soon overthrown and eventually executed by the supporters of Shir Ali Khan, since he was considered to be a puppet of the Emir of Bukhara. The main political figure in the Khanate was Mingbashi Musulmonqul, a military commander, who declared Khudayar Khan, his son-in-law, the khan of Kokand. Khudayar was in Namangan during the uprising and thus survived. In the 1840s, Khudayar Khan was essentially locked in the palace in Kokand, whereas the Kipchak nomad elite under Musulmonqul had all the power in the Khanate. In 1853, there was an uprising against the Kipchaks, and a large number of them were killed, including Musulmonqul. Khudayar Khan continued to rule on his own and took an anti-Kipchak and pro-Uzbek position. He put the northern parts of the Khanate under special government, and appointed Mirza Akhmad to be the governor. In 1858, the northern provinces rebelled. Khudayar Khan sent his brother Mallya Bek to Tashkent to suppress the rebellion. Instead, Mallya Bek joined the rebels, conquered Kokand, and proclaimed himself a khan. He was supported by Alimqul, a Kipchak and a powerful warlord. Khudayar had to flee.
In 1862, Muhammad Mallya Beg Khan was assassinated, and his nephew, Shah Murad Khan, became the khan. The ruler of Tashkent, Kanaat, allied with Khudayar, and Shah Murad besieged Tashkent. At the same time, Muzaffar, the Emir of Bukhara, advanced to Kokand. As the result, the Kokand army disappeared, the siege of Tashkent was lifted, and Khudayar moved to Kokand and declared himself a khan. In the meanwhile, in Osh Alimqul got rid of possible throne claimants, promising all of them the throne, prompting them to go to Osh and executing them. In July 1863, he proclaimed Muhammad Sultan Khan, a son of Muhammad Mallya Beg Khan, the Khan of Kokand. Alimqul himself was a regent, since Sultan was about thirteen years old. He launched an attack on the Khudayar's forces, and at the same time Muzaffar had to return to Bukhara to suppress a rebellion which started in Shahrisabz. Alimqul managed to agree with the Emir, launched simultaneous attacks on Kokand and Tashkent, and finally took them under control.