With the consolidation of the Treaty of Georgievsk, Russia annexed eastern Georgia and Dagestan in 1801, dethroning the Bagrationi Dynasty. In 1803, Fath Ali Shah was determined to get Georgia and Dagestan back, and fearing Russia would march on more south towards Persia and the Ottoman Empire too, declared war on Russia. While starting with the upper hand, Russians were ultimately victorious in the Russo-Persian War (1806-1813). From the beginning, Russian troops had a great advantage over the Persians as they possessed much modern Artillery, the use of which had never sunk into the Persian army since the Safavid dynasty three centuries earlier. Nevertheless, the Persian army under the command of Abbas Mirza managed to win several victories over the Russians. Iran's inability to develop modern artillery during the preceding, and the Qajar, dynasty resulted in the signing of the Treaty of Gulistan in 1813. This marked a turning point in the Qajar attitude towards the military. Abbas Mirza sent a large number of Persians to England to study Western military technology and at the same time he invited British officers to Persia to train the Persian forces under his command. The army's transformation was phenomenal as can be seen from the Battle of Erzeroum (1821) where the new army routed an Ottoman army. This resulted in the Treaty of Erzurum whereby the Ottoman Empire acknowledged the existing frontier between the two empires. These efforts to continue the modernisation of the army through the training of officers in Europe continued until the end of the Qajar dynasty. With the exceptions of Russian and Imperial British armies, the Qajar army of the time was unquestionably the most powerful in the region.