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. With his new army, Abbas Mirza invaded Russia in 1826. While in the first year of the war Persia managed to regain almost all lost territories, reaching almost Georgia and Dagestan too, the Persian army ultimately proved no match for the significantly larger and equally capable Russian army. The following Treaty of Turkmenchay in 1828 crippled Persia through the ceding of much of Persia's northern territories and the payment of a colossal war indemnity. The scale of the damage done to Persia through the treaty was so severe that The Persian Army and state would not regain its former strength till the rise and creation of the Soviet Union and the latter's cancellation of the economic elements of the treaty as 'tsarist imperialistic policies'. After these periods of Russo-Persian Wars, Russian influence in Persia rose significantly too. The reigns of both Mohammad Shah and Nasser al-Din Shah also saw attempts by Persia to bring the city of Herat, occupied by the Afghans, again under Persian rule. In this, though the Afghans were no match for the Persian Army, the Persians were not successful, this time because of British Intervention as part of The Great Game "(See papers by Waibel and Esandari Qajar within the Qajar Studies source)".