He defected from the army to fight against the Soviets in the Soviet–Afghan War,[6][7] first with Mohammad Nabi Mohammadi's Islamic and National Revolution Movement of Afghanistan, then with Abdul Rasul Sayyaf's Islamic Union for the Liberation of Afghanistan, as commander of its south-western front.[8] He had a role with Sayyaf in liaison with Pakistani military intelligence. He was more urbane than most Afghan mujahideen, and when in Quetta, Pakistan, in the 1980s he often dined at restaurants with his wife. Other mujahideen gossiped about this; in return Stanikzai criticised them for old-fashioned ideas about keeping women secluded in their homes.[9]