This article offers a fresh account of the colonial processes that upended Muslim juridical regimes in South Asia between 1808 and 1885. Based on unexplored sources in Arabic and English, the discussion is set in the South Indian coastal towns of today’s Kerala and Tamilnad, where Muslims practiced Shafi‘i law and were not subject to continuous Muslim rule at any point in history. Given their longue-durée experience of non-Muslim rule, the Shafi‘i jurists had to rethink classical jurisprudential norms to empower the learned Muslims (the ‘ulama) as alternative sources of authority, so that they could elect and dismiss Islamic law judges (qazis) as their local leaders in the coastal towns. Qazis thus emerged and operated as a bastion of Shafi‘i power and Shafi‘i religious authority in the region. Once the British Empire claimed the mantle of the Mughal Empire that practiced Hanafi law, it could not as easily bring these Shafi‘is into its imperial fold. Their juridical autonomy provoked fears of political subversion for the British Empire in the wake of the 1857 rebellion, prompting its officials to bring the Shafi‘is under direct government control and reconfigure the community-elected qazis, which were the foci of Shafi‘i leadership.