The article explores the life of the akhun of Petropavlovsk, Siraj ad-Din ibn Saifulla al-Kyzyl'iari, in the context of the multifaceted relations and connections that emerged between Muslim ulema and their Kazakh environment, imperial authorities, and the Orenburg Muslim Spiritual Assembly (OMSA). Several factors contributed to the behavior of the akhun and made it ambivalent from the point of view of both personal self-identification and observers. Among these factors were the low efficiency of the Russian imperial bureaucracy, contradictory interests of different groups of Kazakhs, and attempts by some in the imperial establishment to overemphasize questions about "fanaticism" and pan-Islamism (characteristic of the mid-nineteenth century). On the one hand, the akhun, like other members of the ulema, recognized Russian imperial domination and strove to be a loyal subject; on the other hand, he could use the weakness of administrative institutions and of the OMSA to pursue his own agenda in the regions. Apparently, he did not perceive these actions as a breach of law, unlike the imperial authorities. A pious Muslim with extensive ties to the world of Islam, al-Kyzyl'iari functioned in the narrow space of Islamic discourse, which, according to its own logic of development, transcended the imperial order. His tragic life cannot be explained solely by references to the changes in confessional policies of the Russian empire in the Kazakh steppe in the mid-nineteenth century. It was defined by a range of factors that shaped the complexity of his individual biography as a person who found himself on the boundary of different cultural worlds and social and political transformations.