SRINAGAR, India—An improvised explosive device detonated outside a mosque in Srinagar, the capital of India's portion of the disputed Himalayan territory of Kashmir, killing a moderate Muslim cleric and showing how militants are still able to mount attacks despite a massive security crackdown by Indian forces.

The cleric, Maulana Showkat Ahmad Shah, was entering a mosque in the old part of Srinagar to deliver Friday prayers when the bomb went off. One other person was injured and there was little damage. Police said the small...