In 1200, the area earlier and later known as Persia was under the rule of the Great Seljuks. 1205 however, Muhammad II of Choresm conquered it and made himself Shah. From now on, Persia was a part of Choresm.
The Choresmian rule continued more or less successful until 1362, when a Shi'ite revolt in Persia began, which would eventually lead to Persia becoming independent again. In 1363, the Caliphate in conquered Baghdad was abolished by the Shi'ites; now the Rum-Seljuks claimed the Caliph title for themselves / their Abbasid puppets. 1365, the Persians had thrown off the Choresmian yoke completely, forming a new Shi'ite empire under the Zahedid dynasty (named after an old Sufi order) that included Azerbaijan and Mesopotamia. Afghanistan also became independent again.
1377-81, the Black Death hit Persia. However, the same fate struck Choresm 1378-85, preventing a reconquest of Persia.
Since 1400, the Shi'ite rulers of Persia started persecuting the Ismailite minority. The Assassins fought back, but had lost their edge.
In the years 1416-19 (3113, Yang Fire Monkey / 3116, Yin Earth Pig in their calendar), Chinese Treasure Ships made the great voyage, went to Hormuz, visited Persia and opened diplomatic relations. Following them, Chinese merchants opened new trade connections.
After the Rum-Seljuks had made Egypt a tributary in 1450/51, where they demonstrated their military power (cannons, large standing army), Persia and Choresm were the only other major Muslim powers left.
Under the Pashtuns
1515, the "decadent" Persia was overrun by Sunni Pashtuns from Afghanistan who founded a new dynasty, which would reign for the next centuries. Choresm Shah Atsiz IV used the opportunity 1520 to invade Persia and to take Chorasan for his empire.
In 1528, the Pashtun ruler of Persia attacked and defeated the last Ismailite strongholds. The Assassins were history.
In the years 1539-48, the Seljuk-Persian War happened, where Persia was backed and influenced by Hong China. Many battles in Mesopotamia happened. At the end, the Seljuks win again, and took Hormus, but the war used up a lot of their resources.
While there was some resistance from the loyalists of the old dynasty, in 1551 the last Zahedid claimant for the throne was caught with his remaining followers and killed.
In a short war 1585-87 Persia attacked Choresm, took Chorasan back.