afghanistan shares a relatively long history with iran (called persia in the west before 1935) and it was part of many persian empires such as achaemenid and sasanian dynasties. when the safavid dynasty was founded in persia, part of what is now afghanistan was ruled by the khanate of bukhara and babur from kabulistan. the first iranian safavid shah shah ismail i quickly expanded his empire in all directions, in which he also conquered large parts of nowadays afghanistan. for centuries they ruled the region and the safavids didn't have any problems at first ruling the eastern most territories of their empire, but their policy towards non-shia subjects became worse and worse over time. wars began between the shia safavids and the larger sunnis, particularly in the old kandahar region. by the late 17th century, the safavids were heavily declining. they had appointed their georgian subject gurgin khan as governor of kandahar in order to forcefully convert the afghans from sunni islam to shia islam. this went with much oppression and violence.