Youths shout pro-independence slogans in Srinagar, Indian-controlled Kashmir, as clashes between Indian troops and protesters continued for a fourth consecutive day despite a curfew. (Dar Yasin/AP)

The stones winged through the air, across a bridge separating protesters and Indian security forces in riot gear. The demonstrators had whatever sharp rocks they could pick off the road, the troops had slingshots poised for return fire.

At least 24 people have been killed and hundreds injured in four days of violent protests in Indian-administered Kashmir after the death of a young, social-media-savvy separatist named Burhan Wani. Tires were set ablaze, curfews imposed and mobs took over police stations, holding one officer hostage and drowning another by pushing his vehicle into the Jhelum River.

Officials said it was the worst bout of violence in years in Kashmir, the Himalayan region claimed by both India and neighboring Pakistan and the scene of a decades-long insurgent movement that many say has been bolstered by support from Pakistan.

Indian Prime Minister Narendra Modi on Tuesday appealed for peace through one of his junior ministers. But the vehement reaction to Wani’s death took many in the government — and even some hard-line separatists — by surprise.

“Indian troopers shoot at us. Our weapon is only the stone,” said one of the protesters, Nisar Ahmad Bhat, 30, who owns a small company that makes cricket bats. “Burhan Wani is our freedom fighter. He is a real person, a hero to us.”

In recent months, Wani, the operational commander of the terrorist group Hizb ul-Mujahideen, had become somewhat of a folk hero in this region by boldly uncovering his face and posting photos and videos online that show him and his cohorts playing cricket and posing with guns while in hiding. He was killed Friday in a shootout with police, and his funeral was attended by thousands.

In Wani’s home town of Tral on Tuesday, young men hung on to large flatbed trucks making their way slowly through the streets, shouting “Freedom!” and “One solution, gun solution!” and waving Pakistani flags. Women watched from the sidelines, some with tears in their eyes. Others offered cups of water to the protesters as the temperature soared past 90 degrees.

Mourners crowded around a tent set up at the home of the Wani family, adorned with banners of the slain man, a leader of a group suspected to have killed more than 200 civilians and 100 police officers in the past decade, according to a December estimate by the Institute for Conflict Management in New Delhi.

“We are happy. My son fought for the people of Kashmir,” said his father, Muzafar Hussain Wani, a school principal. “We don’t know if he was involved in any violence. Only he knows himself. Police say he was involved in attacks. But the police, these are our enemies. And the mujahideen [fighters] attack them. It is the job of the mujahideen to attack them. That was my son’s job.”

In a sequestered area of the home, heavily veiled women sat together on the floor, already beginning to weave the fabric of the martyr’s myth.

Burhan Wani’s mother, Mymoona Muzafar Wani, said she recalled one time when she was praying and Wani asked what she was praying for.

“I told my son I wanted him to be a doctor or an engineer,” she recalled. “He told me I should pray that he become a martyr.” He left home about a year after that conversation, when he was 15.

Wani’s growing repute refocused attention on the faltering Hizb ul-Mujahideen and helped bring new, often well-educated recruits into its fold at a time of dwindling membership and tighter border security, some analysts said.

Wani “has emerged as the poster boy for a new generation of Kashmiri militants, credited with resuscitating a dying jihad in the Valley’’ with dozens of Facebook fan pages “updated round-the-clock,” the Institute for Conflict Management report said. Wani also announced a recruitment drive on Aug. 21, offering lieutenants a bonus of about $50.

Kamal Kant Sharma, deputy inspector general of the Central Reserve Police Force in Kashmir’s largest city, played down the recruitment drive, noting that the number of militants operating in the area was under 200. He accused Pakistani sympathizers of spreading “fear” among the region’s youths.

Yet many of the young men vowing to join Burhan’s cause in Tral on Tuesday appeared to be well-educated and with decent jobs but angry about growing up in a heavily militarized zone where they said they suffered abuse at the hands of security forces.

One student in a private school said he had taken up stone-pelting in the hope that he could somehow wrest an AK-47 from a soldier or police officer and enlist in the insurgent cause. “I only want jihad, to fight for a free Kashmir,” he said.

He comes from a prosperous family that also had a small business building cricket bats — a common trade in Kashmir. One of his brothers was in jail on charges that he had participated in an insurgent attack last year; another was killed in 2010. Pakistani militants routinely stayed at his home on the way to operations, he said.

Muneer Mustafa, 30, a cousin of Wani’s who is a banker from Dubai, led the way to the graveyard for martyrs, a place where those killed in what is referred to here as the independence struggle are buried. Onlookers somberly passed by, holding their hands aloft in prayer.

Mustafa said he had returned to his home town just a month ago to work for the independence cause. He showed off marks on his body — a scar on his wrist and burns on his back — that he attributed to police brutality after he was taken into custody as a seventh-grader while playing volleyball in the park.

“I’m not scared,” he said. “I have seen so many youngsters lose their lives for Kashmir, what’s one more life?” Of the 11 members who were in his youth cricket team years ago, he said, nine have been killed.