The Five Western Kingdoms period of medieval Iranian history lasted from the downfall of the Sassanid Dynasty in the 920s until the founding of the Mehranid Empire in 1272. During this time, western Iran was divided into a number of rival states, the main ones being Fars, Madastan, Verkana, Kurdistan and Asuristan. Eventually, all came under the control of members of the Bagratid Dynasty.
Four more kingdoms formed in what had been eastern Iran. However, Khwarezm was soon conquered by Turkish settlers, while Khorasan, Baktristan and Sakastan were by 960 reunited into a strong empire, ruled first by the Samanid Dynasty and then by the Shansabanids. The east was conquered by the Mongols in the 1220s, who attempted to venture further west but abandoned such ambitions after the 1255 Battle of Arbela.
After this battle the Mehranids, a prominent family from Rey with an illustrious past, began their rise to power, supplanting the Bagratids in Media by 1272. Over the next few decades they conquered the remainder of the Five Kingdoms, and retook much of the east from the Mongols in 1335. The remaining Bagratid territories in the Caucasus were forced to pay tribute and recognise Mehranid overlordship, thus ending the era of the Bagratid Empire.