During the mid-eighteenth century the Afsharid empire of Nader Shah embarked upon the conquest and annexation of the Khanates of Bukhara and Khiva . The initial engagements were fought in the late 1730s by Nader Shah's son and viceroy Reza Qoli Mirza who gained a few notable victories in this theatre while Nader was still invading India to the south. Reza Qoli's invasions of Khiva angered Ilbars Khan, the leader of Khiva. When Ilbars threatened to make a counter-attack Nader ordered hostilities to cease despite his son's successes and later returned victoriously from Delhi to embark on a decisive campaign himself. 

After annexing Khiva he executed Ilbars and replaced him with Abu al-Fayz Khan, whom Nader considered to be more accepting of Nader's overlordship. The conflict resulted in the most overwhelming Persian triumph against the khanates of Central Asia in modern history and with the admixture of his previous annexation in northern India, Nader's empire in the east surpassed all other Iranian empires before it, all the way back to the Sassanians and Achaemenids of antiquity.

The Conquest of Bukhara
In 1734-35 Ilbars Khan sent a large party of Turkmens in a raid against Khorasan, where they plundered Chameshgazak Kurds in the regions of the Ala Dagh mountain and Samalqan, but then were defeated by the Persian army. In 1737, when Reza Qoli Mirza Afshar, son of Nader Shah and viceroy of the Empire, marched against Bukhara after having subdued the rulers of Balkh and Andkhui, Abu al-Fayz Khan, the ruler of Bukhara, appealed for help to Ilbars Khan, who set out to Transoxania with his army but turned back halfway, apparently in fear of confrontation with Reza Qoli. In 1738, Ilbars Khan set out to invade Khorasan but withdrew after raiding a few localities south of Abivard.

Nader Shah intended to invade Turkestan. This first required the building of a bridge over the Oxus, wide enough for two loaded camels to cross it together. This work was completed in 45 days and Nader ordered his troops to build two fortifications on each bank of the river, each housing 5,000 soldiers. After these preparations, the Persian army, under the command of Nader Shah, headed to Bukhara where the assault was immediately begun, despite the fatigue of the journey. Nader Shah positioned his army such that the components were as follows; right, left, centre, artillery, tail and ambush troops, each position had its own independent commander. The Persian army opened fire on the Uzbeks with cannons, mortars, howitzers and swivel guns as well as the fire of the Jazayerchi. The Uzbeks were shocked into disarray, having never had to deal with such fire power and many of them took flight. After this battle, 30,000 Uzbek soldiers were pressed into the Persian army as auxiliaries.

The Battle of Petnak
In 1740, Nader Shah, after his conquest of Bukhara, turned against Khwarazm and sent an embassy to Ilbars demanding submission; the ambassadors, two of whom were Juybari shaikhs, were executed by Ilbars Khan. Nader Shah routed the army of Khiva in a battle near Petnak at the southern limits of Khwarazm. The next battle saw Nader Shah facing the army of Ilbars Khan, which included among others 30,000 Uzbek and Turkmen horsemen. In the battle, the Persian army crossed the Oxus and swept into action against Ilbars Khan. After a short and bloody confrontation between the two armies, the army of Khwarazm army began to collapse. Many times Ilbars Khan rallied his army, but was defeated every time and finally forced to succumb. At this point and after eight-month campaigning, the Persian army had travelled 3,000 kilometers, a logistical and strategic feat. Ilbars Khan, besieged in the city of Khanqah, surrendered to Nader Shah and was executed together with twenty or more of his amirs (according to some accounts, they were buried alive). The execution was ordered by Nader Shah in revenge for the murder of the Juybari shaikhs, upon the request of their heirs.

Rebellions in the Khanates
Persia gained unprecedented influence in the region as a consequence of Nader's campaigns. Even though a rebellion soon broke out against Nader's new appointee and the Persian army had to be recalled to the region to re-establish control. The revolt was quelled, keeping Central Asia under Persian dominion until the collapse of the Empire.

See also
Military of the Afsharid dynasty of Persia
Nadir Shah Afshar's capture of Samarkand

References

Further reading
 
 

Conflicts in 1738
Conflicts in 1739
Wars involving Afsharid Iran
History of Central Asia
Campaigns of Nader Shah