Erzurum peace treaty was signed with Ottomans. Some border tensions and power struggles finally led to a war declared by Sultan Mahmoud 2nd in Oct, 1820. While the Ottomans' main army was engaged in Europe and they were dealing with revolts and uprisings in Balkans and Greece,Fathali Shah's son Mohammad Ali Mirza advanced towards Baghdad as he had done in 1804 and 1812. Although he was quite successful in two brief encounters, a cholera epidemic broke out and his forces had to retreat. Cholera led to his own death in Nov, 1821 before he could return to his headquarters in Kermanshah. On the other hand, Abbas Mirza, the crown prince advanced inside Anatolia and took Beyazit in Sep, 1821 and advanced towards Erzurum while a second arm of his forces took Tbilisi and advanced towards Diyarbakir but the cold winter forced them to retire to Tabriz. He was able to rout the Ottoman army near Khoy in May, 1822, when cholera devastated his troops too and he was forced to accept the peace offer from Ottomans. The Erzurum Treaty may refer to either of two treaties, in 1823 and 1847, that settled boundary disputes between the Ottoman Empire and Iran.The first agreement was signed in Erzurum on Jul, 28, 1823, restoring the peace treaty of 1746 without change.Although the Treaty of Ghasreshirin in 1639 had established the boundary between Ottoman Empire and Iran, the border in the mountainous Zuhab region remained a site of intermittent conflict in the subsequent two centuries. Ottoman incursions in North West Iran in pursuit of rebel tribesmen made Persians retaliate. This attack prompted Sultan Mahmoud II in 1821 to declare war on Iran. Fathali Shah Qajar's army barely managed to defeat the superior Ottoman army. The first Treaty of Erzurum was signed in July 1823, but it essentially confirmed the 1639 border and thus failed to resolve the disputes that had led to conflict.A series of border incidents in the 1830s again brought Iran and the Ottoman Empire to the brink of war. Britain and Russia offered to mediate, and a second Erzurum Treaty was signed on May 31, 1847. This treaty divided the disputed region between Iran and the Ottoman Empire and provided for a boundary commission to delimit the entire border. The boundary commission's work encountered several political setbacks but finally completed its task in 1914.This Erzurum Treaty was very crucial because both countries relied on the Silk Road for trade. Those wars between the two states devastated the two countries and weakened their integrity alongside the economy of war that made both states poor. Russians and Europeans meanwhile used this opportunity to capture and take control of disputed regions including Caucasia. The Qajar court soon became infected with foreign spies' meddling in country's affairs and concessions were taken at the expense of the nation. Until the Iranian revolution called the Constitutional Movement in the beginning of the 20th century, and a similar movement in Turkey both countries were under European imperialism.