After the death, in 1779, of Mohammad Karim Khan Zand, who was the Zand dynasty ruler of southern Persia, Agha Mohammad Khan, a leader of the Qajar tribe, reunified the country, defeated numerous rivals and brought all of Iran under his rule, establishing the Qajar dynasty.