After the Safavids, the area was ruled by the Iranian Afsharid dynasty. After the death of Nader Shah (r. 1736–1747), many of his former subjects capitalized on the eruption of instability. Numerous self-ruling khanates with various forms of autonomy emerged in the area. The rulers of these khanates were directly related to the ruling dynasties of Iran and were vassals and subjects of the Iranian shah. The khanates exercised control over their affairs via international trade routes between Central Asia and the West.