How does religion impact the courts? In this paper, we document a substantial impact of religious leaders on judicial decision making in Pakistan. Utilizing a unique dataset on the holy Muslims shrines across Pakistan, we show that districts where historically the shrine density was high, a military coup in 1999 induced a large decline in judicial independence and quality of judicial decisions. We present evidence consistent with the view that increased political power of religious leaders to influence the courts is the key mechanism explaining the results. The analysis of the type of cases driving the results show that more favourable rulings for the government in land expropriation and human rights cases explain these results. We also show a judicial selection reform that changed the appointment procedure to select judges from presidential appointment to selection by a judicial commission consisting of peer judges greatly mitigated the effect of historical shrine density on judicial outcomes.