The Qajars were a Turkmen tribe who settled in northern regions in the era of Shah Abbas Safavi due to protecting the borders. During the period of Karim Khan, the Qajar tribe was one of the claimant tribes for establishing a new dynasty but Karim Khan overcame them after the victory, held some of their leaders, including Mohammad Khan, the son of the tribal chief, as a hostage in Shiraz. After Karim Khan’s death, the country was being chaotic, Mohammad Khan used this opportunity and returned to his tribe in Mazandaran and tried to unite the Qajar and other Turkmen tribes.
Then he went to other Iranian tribes and made them obedient through war or agreement. Agha Mohammad Khan struggled for twenty years of battles until he succeeded in the extinction of the Zand and Afsharid dynasties and he was crowned in Tehran, which at that era was a small village and founded the Qajar dynasty.
During the Qajar dynasty, there have been many incidents in Iran, including the First World War and the occupation of Iran, the Persian Constitutional Revolution, the long-standing battles with Russia, the establishment of the first newspapers, and the creation of independent movements.