Indian security forces have killed an influential Kashmiri militant who led the first al-Qaida-affiliated cell in the disputed region, sparking protests and fears of wider unrest.

Zakir Musa, 25, was part of a new generation of young militants with large followings on social media and more affinity with global jihadist groups such as al-Qaida than with Pakistan, the traditional patron of anti-India fighters in the region.

Regarded as the most wanted man in Kashmir, Musa was cornered in a three-storey home surrounded by orchards in a southern district on Thursday. Fighting continued through the night until he was shot and killed at about 6am on Friday.

Security forces had used explosives during the gunfight in Dadsara village, in the southern Kasmiri district of Tral, and were searching for a body when they came under fire again.

The internet was shut down across Kashmir as the battle raged, but word still spread that the militant leader was trapped, leading to protests in parts of the region and the closure of schools and colleges.

Kashmir, in the Himalayas, is claimed by India and Pakistan in full and ruled in part by both. An insurgency has waxed and waned on the Indian-administered side for three decades.

In recent years, the ranks of the militancy have been swelled by Kashmiris, rather than fighters from Pakistan, reflecting a growing disillusionment at the prospect that Delhi will accede to the demands of local politicians for more autonomy for the region, including a referendum on independence.

The Indian army confirmed the death of what it called the “college dropout” in a tweet on Friday morning. Musa had been studying an engineering degree before he vanished and resurfaced as a militant.

Kashmiri people shout slogans during the funeral of Zakir Musa at his native village in Tral area of #Pulwama district in south #Kashmir. pic.twitter.com/Sj16KrY1sb — Bhat Burhan (@bhattburhan02) May 24, 2019

A funeral was held outside Musa’s home on Friday morning and attended by thousands of people who had been waiting outside for hours in heavy rain. More funerals are expected throughout Friday.

Musa was considered to be the successor of another militant, Burhan Wani, as the leader of the militant group Hizbul Mujahideen after Wani was killed in July 2016.

Wani’s death sparked a summer of protests in Kashmir that paralysed daily life in the region. Indian security forces killed about 100 people and blinded and maimed hundreds of others using “non-lethal” pellet guns to try to quell the unrest.

Wani and Musa’s names are scrawled across hundreds of walls across Kashmir’s main city, Srinagar, and its restive southern districts, where young people trade videos of militants giving sermons, training and engaging in more prosaic activity such as cooking or having snowball fights.

In July 2017, Musa was named as the head of Ansar Ghazwat-ul-Hind, a militant group whose establishment was announced on an official al-Qaida messaging channel. The cell was never thought to number more than a dozen people, and the strength of its links to al-Qaida were never clear, but its creation was seen as the deepest inroad the terrorist group had made in Kashmir.

Months before, Musa had announced he was quitting the Pakistan-based Hizbul Mujahideen and repudiated the militancy’s traditional goal of independence, declaring his fight was “exclusively for Islam, so that Sharia [Islamic law] is established here”.

Kashmiri villagers carry Zakir Musa’s body during his funeral procession at Dadsar village in Tral, south of Srinagar, on 24 May. Photograph: Tauseef Mustafa/AFP/Getty Images

“The first phase of militancy in Kashmir was more of a rebellion, it was more political, and now it’s become more ideological, it’s become more deeply rooted in the philosophy of jihad and Islam,” said Khalid Shah, an analyst at the Delhi-based Observer Research Foundation.

“This is not one militant joining in al-Qaida, it’s a total ideological shift that has been happening for years.”

Any large-scale unrest would be the first major test for the Indian prime minister, Narendra Modi, who was re-elected in a landslide on Thursday and whose first five-year term saw a spike both in militant recruitment and deaths. About 53 people are thought to have joined the militancy in 2014, compared with 191 in 2018.