On 27 June – 1 July 1918, in the battle near Goychay, the Ottoman Islamic Army of the Caucasus defeated the Red Army and started advancing towards Baku. At this point, earlier in June, Bicherakhov was in the vicinity of Qazvin, trying to go north. After defeating some Jangalis, he proceeded to check the situation in Baku. Returning on 22 June, he planned to save the situation by blocking the Army of the Caucasus at Alyaty Pristan'. However, he arrived too late, and instead went farther north to Derbent, planning to attack the invading army of the Caucasus from the north. At Baku, he left only a small Cossack contingent. Beside the Russians, the Jangalis also harassed elements of the Dunsterforce going to Anzali on their way to Baku. Once defeated, the Jangalis dispersed. On reaching Anzali in late July, Dunsterville also arrested the local Bolsheviks who had sided with the Jangalis.