During December, Sardar Rafi and his forces reached near Tehran and stopped in Tajrish. From February to March 1917, the Ottoman and German armies were driven out of Iran, and Kermanshah was conquered by General Baratov. Russian and British forces then attacked Tajrish to defeat Sardar Rafi, and in an attack they defeated Sardar Rafi's forces. He retreated to Shahroud with the rest of his men. In March, with a large bribe, the government of Vosough al-Dawla ratified the treaty written in the Tonekabon government and agreed to implement all its provisions, when suddenly the Russian Revolution of March 1917 took place. Sardar Rafi considered this to be his last chance to recover and attack Tehran, but in December 1918, After many clashes, General Dunsterville, in one of last operation of the Dunsterforce, invaded Astarabad, conquered the city, and captured Sardar Rafi. Shortly afterwards, on 5 November, Vosough al-Dawla signed an order expelling Sardar Rafi from the governorship of the province of Astarabad, declaring it an area under British control.