Encyclopaedia of Islam
Mahmud had gone to war against pagan Afghan while campaigning in the Sulayman mountains. Firishta states that Afghans fought on both sides during the war between Mu'izz al-Din and Pithorai in 1192 AD, which Encyclopaedia of Islam says probably indicating they weren't completely converted.