NAINITAL, India — The attackers recorded the gruesome killing on a mobile phone. Then they filmed themselves gloating about the act and threatening the prime minister.
The video — of two Muslim men killing a Hindu man on Tuesday in the state of Rajasthan because they said he had insulted the Prophet Muhammad — spread quickly in India. The authorities shut down the internet in the state over concerns that the case could kindle broader unrest. The men were arrested on terrorism charges, the police said.
The events that led up to the killing began with comments by Nupur Sharma, a spokeswoman for the Bharatiya Janata Party of Prime Minister Narendra Modi. In a television appearance last month, Ms. Sharma made insulting remarks about the relationship between the prophet and his youngest wife — remarks that were condemned by the Muslim world as profaning the prophet.
After the appearance, Mr. Modi’s party moved to try to contain the fallout.
The B.J.P. suspended Ms. Sharma, who retracted her comments. Another party official, Naveen Kumar Jindal, who expressed support for Ms. Sharma’s remarks, was expelled from the party. To try to contain a diplomatic breach with Muslim countries, the party issued a statement saying that it respected all religious traditions and denounced any insults against religious figures.
But the tensions continued to simmer, adding to a backdrop of rising communal violence in India. Protesters took the streets across the country and in other parts of South Asia. On June 10, two Muslim men were killed at a protest calling for Ms. Sharma’s arrest that was held in the eastern Indian state of Jharkhand.
The same day in Rajasthan, the local police said, a complaint was filed against the man who was killed this week. A police official, Hawa Singh Ghumaria, said that some Muslims had taken offense to a WhatsApp status of the tailor, Kanhaiya Lal Teli, posted in support of Ms. Sharma. He was arrested but made bail.
Mr. Teli, a tailor, returned to the police to file a complaint of his own: the people who had objected to his behavior were sending him death threats. The police addressed the grievances of Mr. Teli and the Muslim community, with both sides agreeing that the matter was resolved, according to Mr. Ghumaria, the police official. The police did not act further on Mr. Teli’s complaint, he said.
Mr. Teli skipped work for the next few days because of the threats, his wife, Jashoda, told India media. He returned to work on Tuesday. It was then that the two Muslim men visited his shop, pretending to be customers.
After having their measurements taken, they attacked Mr. Teli. He can be heard screaming for his life.
Then, in what appeared to be a second video, one of them issued a warning.
“Listen, Narendra Modi, you have lit the fire, but we will douse it,” he said, as the men brandished their daggers. “I pray to god that this dagger will reach your neck one day, too.”
The Indian government has deployed a team of National Investigative Agency, India’s primary counterterrorism force, to investigate the incident, which led to protests in Rajasthan on Wednesday.
“The central government is immensely concerned,” said Kanchan Gupta, a government spokesman, “not least of all because the assailants threatened to come after Narendra Modi next.”
Rajasthan’s chief minister, Ashok Gehlot, of the rival Congress party, called on Mr. Modi to address the people over the communal tension in the country.
“It is more impactful if the prime minister speaks. I believe that the prime minister should address the country on this occasion and should make an appeal that we will not tolerate violence at any cost. What is the problem in saying so?” he said.
Emily Schmall contributed reporting from Kathmandu, Nepal.