Another civil war ensued after the death of Karim Khan in 1779, out of which Aqa Mohammad Khan emerged, founding the Qajar Dynasty in 1794. In 1795, following the disobedience of the Georgian subjects and their alliance with the Russians, the Qajars captured Tblisi by the Battle of Krtsanisi, and drove the Russians out of the entire Caucasus, reestablishing a short-lived Iranian suzerainty over the region. The Russo-Persian wars of 1804–1813 and 1826–1828 resulted in large irrevocable territorial losses for Iran in the Caucasus, comprising all of Transcaucasia and Dagestan, which made part of the very concept of Iran for centuries, and thus substantial gains for the neighboring Russian Empire.