SRINAGAR, India — Indian security forces said on Thursday that they had killed one of the most wanted militants in the Kashmir Valley, a man they said was responsible for a recent attack on pilgrims who were visiting a religious shrine.

The authorities said they had fatally shot the militant, Abu Ismail, who was connected to several recent attacks, and a man whom they called a fellow “terrorist” who was with him, after a brief gun battle on the outskirts of Kashmir’s biggest city, Srinagar.

“It was a very brief and crisp encounter,” said Munir Khan, the Kashmir police chief.

For more than 25 years, the Kashmir Valley of northern India has been plagued by conflict. Nestled among sculpted green mountains, the valley is predominantly Muslim, and many here want to secure independence from India, which is majority Hindu, or to join Pakistan, which is predominantly Muslim. Beyond religious issues, many Kashmiris say that Indian forces harass and brutalize them and that Kashmiris should rule themselves.

Several militant groups have sprung up, and Indian security forces have tried to wipe them out.

The Indian authorities said they had been closing in on Abu Ismail in recent days. They described him as a major player in Kashmir’s militant scene, a hardened fighter in his mid-20s who was born in Pakistan and had been organizing attacks in India for at least two years.