
In the Struggle Against the Kokand Rulers
Starting from the 1760s, the rulers of the Kokand feudal domain (later a khanate), seeking to expand its territory at the expense of southern Kyrgyz lands, turned their greedy eyes towards the city of Osh.
Even at that time, Osh played a significant role in the political history of the Kokand Khanate. Narrative sources briefly mention that its ruler was the feudal lord Hadji-biy, considered the head of the large Kyrgyz clan Adygene within the tribe of Ichkilik. This was a large tribal union in Southern Kyrgyzstan, settled in Alai and the Pamir-Alai mountains, also migrating in the Osh district. It included both numerous "newcomers" and the local Kyrgyz population, who had lived on the territory of Pamir-Alai since ancient times.
As the ruler of Osh, Hadji-biy, as indicated by Eastern sources, could muster "200,000 people from the Burut horde, scattered from Bukhara to the East." This data (even if the figures are exaggerated) indirectly indicates that the city of Osh had significant political importance in Fergana in the mid-18th century.
Another Kyrgyz tribal ruler from the Ichkiliks, Kubat-biy (or Kavad-mirza), also played a major role during this period. According to Bukhara chronicles, he was "a companion and support of Irdana" — the Kokand ruler. Initially an ally, he was later suspected of treason and unexpectedly left Irdana-biy, which doomed him to defeat in the struggle against the ruler of Uratyub. Kubat-biy simply "took all his Kyrgyz and departed." His power and strength were such that Kubat-biy established diplomatic relations with the Qing Empire, corresponding not only in his own name but also on behalf of his ally — the ruler of Kokand. It turned out that Kokand and Osh were acting as equals on the international stage, particularly in contacts with the neighboring Qing Empire.
However, as the Kokand domain strengthened and rose, its rulers began to view neighboring cities as desirable objects of conquest. In 1762, Irdana-biy, taking advantage of inter-feudal strife among the Kyrgyz, attacked them, devastating their lands "in the country of Uze" (Uzgen). The pretext for this was the robbery of Kokand merchants by Kyrgyz feudal lords (from the Adygene clan). The ruler of Osh, Hadji-biy, leading the united forces of the Ichkiliks, Adygenes, and Mongoldor, opposed Irdana but was defeated. The Kokand forces captured the city of Osh, hypocritically claiming that it had allegedly belonged to Kokand for a long time and was now returned to the khanate. The Kyrgyz troops retreated into the mountains but did not cease fighting. When two years later the Kokand ruler set out from Osh to conquer Khojent, Hadji-biy unexpectedly attacked the Kokand domain from the east. Irdana was forced to return and unleashed all his strength on the Kyrgyz. Hadji-biy was captured, but apparently not for long, as Osh is soon mentioned again as under Kyrgyz control. However, Osh was no longer able to seriously oppose the strengthened Kokand, and subsequently, in sources, it is referred to merely as one of the cities of the Andijan vilayet of the Kokand domain, and later as an independent vilayet. In economic documents of the Kokand Khanate from the 1850s to 1870s, "the vilayet of Osh" is often mentioned among other areas of the khanate subordinate to its capital — Kokand.
However, the majority of Kyrgyz tribes, it seems, had not yet submitted to Kokand. This is noted, in particular, by the "involuntary traveler" Philip Efremov. He was initially a Kazakh, then a Bukhara captive, who escaped through Osh to Alai and India at the end of the 18th century, circumnavigating Africa on an English ship and only returning to St. Petersburg through England. Here he soon published his notes, which quickly gained popularity, in which he recounted his "odyssey." So, F. Efremov narrates in his book that even in the 1770s, the southern Kyrgyz moved freely between Osh and Kashgar "in small herds," were practically independent, had their own "princes," and engaged in barter trade with Kokand. But this did not last long. Narbuta-biy gradually expanded his power over the surrounding territories where the Kyrgyz roamed. Having established himself in Osh and Alai, the Kokand feudal lords continued their predatory campaigns into other areas in southern Kyrgyzstan, in Ketmen-Tyube and to the north of the region.
The Bukhara Invasion of Fergana
The successful conquest of Kyrgyzstan by the Kokand khans was facilitated by inter-clan and tribal strife among the Kyrgyz feudal lords, who were unwilling to unite even in the face of a common enemy. Thus, in late summer 1821, Omar-khan sent Beknazar-biy — his loyal Kyrgyz feudal lord, who headed the Kutluk-Seyid clan and was simultaneously the hakim of the city of Kasan — to subjugate the Kyrgyz of the Sarybagysh clan, who were migrating beyond Osh on the way to Kashgar. Omar-khan ordered that "the Kutluk-Seyid tribe with their detachment [lashkar], having taken care of equipment and supplies for gunfire, should set out with all diligence on horseback. It was ordered to destroy all the time [the Sarybagysh], giving no mercy to anyone from ... the tribe..." To assist the Kyrgyz feudal lord in his predatory raid, a detachment of Kokandis was assigned. "Having committed terrible robberies and murders, among which neither women nor children were spared, taking a large booty [mainly livestock] and a mass of captives," — noted in Kokand sources, Beknazar-biy returned to Kokand with the khan's detachment. As a result, not only through the force of arms but also skillfully using the rivalry and enmity among the Kyrgyz feudal lords, the Kokand khans expanded their possessions at the expense of neighboring southern Kyrgyz lands. Specifically, through them lay the trade route to Eastern Turkestan and India.
One of the trade routes ran directly through Osh to Kashgar. To ensure its safety, Madali-khan ordered the construction of two fortifications in Alai — Sufi-Kurgan and Kyzyl-Kurgan, which was executed by the Andijan hakim Isadatkha in the 1820s.
Later, this played a significant role in preventing Qing aggression in Fergana. When Chinese troops launched a campaign from Kashgar to Kokand, they did not dare to take the Alai fortifications, and after standing before them for 20 days, retreated empty-handed.
In the early 1840s, the Bukhara invasion of Fergana began. Temporarily, power on the Kokand throne fell into the hands of the emir's appointee from Bukhara — Ibrahim-khayal parvanachi. He, as a true conqueror, immediately imposed exorbitant taxes on the population, and the Bukhara soldiers who came with him began to riot and plunder the residents with impunity. Soon this led to a general uprising in Kokand, in which the Kyrgyz played an important role. The Kyrgyz feudal lords decided to elevate Sheraly, who had been languishing in the nomadic camps on Talas, one of the descendants of the Kokand dynasty of Ming, to the throne. Taking advantage of the popular uprising, the ruler of the Kyrgyz clan Kyrk-ogul, Yusuf-minbashi, along with his supporters, brought Sheraly from Talas to his clan's nomadic camps by the Kara-Su River in the vicinity of Osh. Here, rebel detachments of Kyrgyz and Kipchaks began to gather from all sides. Here, at the mazar of Safid-Bulan, following traditional nomadic rituals, Sheraly was raised on a white felt and proclaimed khan. From here, the significant army, consisting mainly of Kyrgyz and Kipchak rebels, easily occupied fortresses, villages, and cities (presumably without a fight, including Osh), and triumphantly entered Kokand. Ibrahim-khayal fled to Bukhara. As noted in Kokand sources, he ruled for only a month and seventeen days (though other sources state — 79 days), and then an uprising broke out, as a result of which "from the group of Sartiya and Kipchak and Kyrgyz in agreement with all the Fergana people" Sheraly was elevated to the throne.
Initially, Sheraly was a rather indifferent to power, peace-loving person. Rumor attributed to him the following couplet: "Usually, when khans embark on a path, rain falls (prosperity pours). What kind of khan are you when blood flows from the eyes of the people on your path?" However, soon the "good words" diverged from his deeds. The methods of governance, tax oppression, and exactions of Sheraly, surrounded by greedy feudal lords who had elevated him to the throne, did not differ from those that existed during the rule of his predecessors. The Kyrgyz feudal lords complained about the charters with the right of power over clans and tribes, receiving control over cities and villages. Gradually, the Kipchak grouping led by the clever, cruel leader Musulmanqul gained more influence at court. The oppression of the Kyrgyz intensified, who expected, on the contrary, a relaxation of tax burdens. And in 1845, a new uprising of the southern Kyrgyz broke out. The Kokand historian Mulla Niyaz Muhammad in his work "Tarikh-i Shahrokhi" narrates about this event: "The confusion and anxiety that seized the hearts of the Kipchaks were caused by the fact that news of the Kyrgyz uprising in the vicinity of Osh, [which covered the area] up to Uch-Kurgan and to the border of Alai, and about the siege of Osh reached the Kipchaks of Shahristan, who informed Musulman-Kuli" — the leader of the Kipchaks, who was the de facto ruler of Kokand.
The Uprising of the Kyrgyz
The uprising of the Kyrgyz was led by Alymbek-datka, Saidbek-datka, Pulat-datka, and other Kyrgyz feudal lords. The rebels besieged the fortress of Mady and the city of Osh itself, which they likely captured. The main role in the uprising was played by the Alai Kyrgyz, later supported by the surrounding population of Osh. The Kipchak feudal lords from Shahristan, led by Kur-ogly, who set out to suppress the uprising, along with the troops of the Kokand commander Musulmanqul, defeated the rebels.
In "Tarikh-i Shahrokhi," it is stated: "After receiving this alarming news [about the uprising, the Kipchaks], setting aside Tashkent affairs, engaged in repelling the Kyrgyz. Having no other means and forced by necessity, they gathered a koshu and began to advance on the Kyrgyz. A Kipchak named Kur-ogly, who was the ruler [hakim] of Shahristan, set out with the koshu of this vilayet two days earlier than the troops of the capital and, encountering the Kyrgyz, put them to flight."
From Osh, captured Kyrgyz were sent for execution in Kokand. On market day, they were brought to the khan's urda. A large crowd gathered in the square. Taking advantage of the absence of Musulmanqul and the main Kokand troops, disgraced feudal lords — a certain datka Rahmatulla-mirza and the hakim of Isfarin, Kyrgyz Satybaldy, conspired against Sheraly. They called for the help of the Kyrgyz of Alai. The captured Osh residents seemingly played a certain role as well. The coup ended with Sheraly being executed — "forced to drink the cup of martyrdom," and Murad-bek — one of the sons of Alim-khan was elevated to the throne. However, he did not remain on the throne for long — only eleven (according to some sources — seven) days. But, according to contemporaries, his main desire in life was "to reign for at least two days." Murad had no social support; the Kyrgyz detachment that arrived with him numbered only 100-200 people, and soon Kokand fell into the hands of the enterprising Kipchak leader Musulmanqul, who placed the minor son of Sheraly, Khudoyar-khan, on the throne.
Over the years, Khudoyar-khan became increasingly burdened by the guardianship of his powerful regent Musulmanqul, who also became the father-in-law of the khan. He waited a long time for his moment but took revenge with extreme cruelty. In 1853, relying on the Uzbek nobility, Khudoyar-khan ordered the execution of the regent-Kipchak Musulmanqul and "to wipe out all Kipchaks and Kyrgyz from the face of the earth." And the khan's henchmen, carrying out the order, killed them in all cities — from Kokand to Osh, as well as in markets and roads, exterminating them indiscriminately by age and gender. Thus, by inciting interethnic strife, the khan and his court entourage — the true culprits of all the people's woes — skillfully diverted the people's anger away from themselves.
In general, the city of Osh, as one of the peripheral cities of the khanate, surrounded by "restless" Kyrgyz nomads, repeatedly became the center of the anti-Kokand uprising movement. Here, dissatisfied with the khan's power, claimants to the throne sought support and refuge. In 1858, Mallya-bek, the elder brother of the ruling Khudoyar-khan, decided to fight for the throne, finding support from Kyrgyz feudal lords. But the conspiracy was uncovered, and Mallya-bek fled to Osh, visited Kara-Su and Uzgen, seeking help and support from the influential Kyrgyz feudal lord, the Alai tribal leader Alymbek ibn Hasan-biy. He, "being in great power among all the nearest Kyrgyz" and having his base in Kara-Su, supported Mallya-bek's uprising. As a result, in the same 1858, Mallya-bek triumphantly entered Kokand. Kyrgyz tribal leaders received important appointments: Alymbek-datka became the ruler (hakim) of Andijan, Saidbek-datka was sent to Khojent, Mulla Kasym — to the fortress of Nau, etc. Soon Alymbek-datka became the chief vizier, and the Kyrgyz feudal lords temporarily seized political power in the khanate.
But as soon as Mallya-khan decided to infringe upon the interests of the close Kyrgyz-Kipchak grouping and remove the Kyrgyz feudal lords from the political arena, he "was stabbed at night in the urda by some hired Kyrgyz." According to Kokand sources, the execution was carried out in February 1862 by parvanachi Alymbek, Khydyr-biy eshikagasi, parvanachi Shadman-khodzha, Khuday Nazar-datka, Dust-Mikhtar, Muhammad Ibrahim Mirzabashi, and other feudal lords from the Kyrgyz, Uzbeks, Kipchaks, Turks, etc. In some sources, it is mentioned that the decisive role in this was played by Kyrgyz Alymbek-datka (already a parvanachi), while in others — Kipchak Mulla Alimkul — a rival of Alymbek. The grandson of Sheraly, Shahmurad, was elevated to the throne, but he remained in power for less than a year.
Later, when Khudoyar-khan once again regained the Kokand throne with the help of the Bukhara emir, Kyrgyz and Kipchak feudal lords fled from Kokand in search of refuge in Andijan and Osh.

The Active Participation of the Osh Residents in Anti-Khan Uprisings
From Osh, the leader of the Alai Kyrgyz, Alymbek-datka, also opposed the khan's court when he rose to the highest ranks of the khanate. In general, the Alai tribal leaders viewed Osh as a sort of stronghold in Fergana, having lands, houses, trading shops here, building mosques and madrasas, and designating their own property as waqf. One of the largest madrasas in the Kokand Khanate was also built by Alymbek in Osh on the right bank of the Ak-Bura River, which had large land holdings as waqf property. All this gave not only political but also economic weight to the Alai feudal lords in Osh. In the struggle for power and influence in the Kokand Khanate, Alymbek-datka and the Kyrgyz-Kipchak leader Alimkul often used the support of the Kyrgyz population, who roamed in the mountains of Priferghania and Alai. As reported in his brief essay on the history of Kokand by American journalist Y. Skyler, who traveled through Turkestan at that time, Alimkul, in his opposition to Khudoyar-khan in the early 1860s, invited three khan's henchmen — probable claimants to the throne — Mirza-Akhmet, Sadikbek, and Khadzhibek to the city of Osh and killed them. They were buried on a hill at the foot of Suleiman Mountain. The residents of Osh and the surrounding Kyrgyz repeatedly took the most active part in anti-khan uprisings — whether it was a rebellion against tax oppression or the promotion and support of a new claimant to the khan's throne. With their active participation, Sheraly was proclaimed the khan of Kokand, at another time — the nine-year-old son of Mallya-khan — Sultan-Said, they attempted to elevate Khudoyar's own brother — the ruler of Margilan and Osh, etc. It is characteristic that the Osh residents always opposed the cruel rule of Khudoyar-khan, siding with his rivals and opponents. In times of failure, they retreated into the mountains or even crossed into Russian territory.
The almost continuous wars of the Kokand khans with neighboring rulers, especially the Khiva and Bukhara khans, the unending feuds among the feudal elite of the multi-ethnic settled and nomadic population of the khanate, often ending in palace coups and changes of khan, and the brutal reprisals against participants in popular uprisings — all this hindered the economic and cultural development of cities, including Osh, worsening the situation for both urban workers and the surrounding nomadic Kyrgyz.
Despite the fact that Osh was located on the remote outskirts of the khanate, the city often found itself in the zone of military actions and feudal turmoil, and its inhabitants became involuntary victims or, at best, witnesses of military clashes and bloody feudal strife that weakened the khanate. The Kyrgyz could never fully reconcile themselves to khan's rule and took advantage of any opportunity for armed uprisings against the Kokand oppression. As the Turkestan Governor-General K. P. Kaufman wrote to the military minister D. A. Milyutin on December 3, 1875, "the history of the Kokand Khanate represents a series of incessant uprisings of the Kipchaks and Kyrgyz and the struggle of the state power of the Kokand Khanate against this restless element."