“We will hunt them down,” said the Governor of Jammu and Kashmir, Satya Pal Malik.

But with heavy snow blanketing the mountains of Kashmir and the disputed border, an attack on targets inside Pakistan may be logistically impossible at the moment, said Rahul Bedi, a defense analyst with the London-based Jane’s Information Group.

Prime Minister “Modi has very little room to maneuver,” Mr. Bedi said. “He can come down on the Kashmiri people in a harsher way, he can deploy the army, the police, the paramilitary. But he can only do more of the same.”

The government of Jammu and Kashmir broke down last year, after Mr. Modi’s ruling party ended its alliance with a powerful regional party. That has left the state under the control of the central government in New Delhi.

“Kashmir is a pressure cooker,” Mr. Bedi said, a situation that “doesn’t leave the people with any way to channel their anger or ambitions.” He added that most militants in Kashmir are now “homegrown,” not slipping across the border from Pakistan.

A video appeared online featuring a man who claims to be the assailant in Thursday’s attack and who gives his name as Aadil Ahmad Dar and his age as 18 years old.

“Don’t think that because you have killed some of our commanders that we are finished. We will become your nightmare,” Mr. Dar said in the video.

Mr. Dar said that he had joined the Jaish-e-Muhammad a year ago and that he was from a region of the southern Kashmir valley that has witnessed sporadic violence since Burhan Muzaffar Wani, the charismatic leader of a Kashmiri militant outfit, was killed by the security forces in 2016.