The conversion of Ghur occurred over a long period and it was mostly pagan until the 10th century, which Mohammad Habib and Khaliq Ahmad Nizami say was probably a result of the missionary activities by the Karramiyya movement established in the region in 10th–11th centuries. Its imperfect conversion is visible by the fact that while the people of Ghur had Muslim names, they led the life of pagans. Muhammad b. Suri, who had acknowledged Sabuktigin as his sovereign, withheld tribute after his death, started plundering caravans and harassed the subjects of Mahmud. Rawżat aṣ-ṣafāʾ called him a pagan, and al-Utbi stated that he was a Hindu. In 1011, Mahmud dispatched an expedition to conquer Ghur under Altuntash, governor of Herat, and Arslan Hajib, governor of Tus. Muhammad b. Suri, the king, placed himself in inaccessible hills and ravines. The Ghurids were however defeated and Suri was captured along with his son Shith. Abu Ali, who had remained on good terms with the Sultan, was made the ruler of Ghur by him. Eastern Ghur was brought under Ghaznavid control. In 1015, Mahmud attacked Ghur's southwestern district of Khwabin and captured some forts. In 1020, Mahmud's son Ma'sud was dispatched to take Ghur's northwestern part called Tab. He was helped by Abul Hasan Khalaf and Shirwan, chieftains of the south-western and north-eastern regions respectively. He captured many forts, bringing the entire region of Ghur, except maybe the inaccessible interior, under Ghaznavid control. He also captured the stronghold of the chieftain Warmesh-Pat of Jurwas, levying a tribute of arms. Minhaj al-Siraj Juzjani praises Abu Ali for firmly establishing Islamic institutions in Ghur. The progress of Islam in this divided region after his death is however unknown. Ghur remained a pagan enclave until the 11th century. Mahmud who raided it, left Muslim precepts to teach Islam to the local population. The region became Muslim by 12th century, though the historian Satish Chandra states that Mahayana Buddhism is believed to have existed until the end of the century. Neither Mahmud nor Ma'sud conquered the interior. Habib and Nizami say that the Ghurids were gradually converted by propagandists of new mystic movements. The Shansabani eventually succeeded in establishing their seniority in Ghor, if not its unification. By the time of Sultan Bahram, Ghur was converted and politically unified. According to Minhaj, both Ghiyasuddin and Mu'izzuddin were Karamis who later converted to Shafi‘i and Hanafi Islam respectively.