Prime Minister Narendra Modi has suffered a series of political reverses in recent months but widespread anger after 40 troopers were killed in an Islamist militant attack last week could lead to a surge in support for his Hindu nationalist party.
As emotions run high following the deadliest attack on security forces in decades, Modi, who faces a general election by May, said he had given a free hand to security forces to avenge the killings in Kashmir, the region disputed with arch-foe Pakistan.
Tensions between the nuclear-armed rivals have ratcheted up and shouts of "down with Pakistan" and "blood for blood" have reverberated at funerals of the victims. Many Indians have held candle-lit marches across the country demanding the government "not forget, not forgive".
The attack has been claimed by the Pakistan-based Jaish-e-Mohammad militant group but the Pakistan government has denied any responsibility.
Rakesh Kumar, a 32-year-old part-time teacher in Kasba Bonli town in the western state of Rajasthan, said he was now inclined to vote for Modi's Bharatiya Janata Party (BJP) in the national election after backing the main opposition Congress in a state vote late last year.
"If he teaches Pakistan a lesson, support for him will rise," Kumar said in a telephone interview. "It's a matter of the country's security, and we need to see what he can do for us."
The BJP was ousted from power in three major states, including Rajasthan, in December, and Modi has been blamed for weak rural incomes and an inability to provide employment to the millions of young Indians entering the job market each year.
Although still tipped to win, pollsters had said before the attack that the ruling party could fall short of a majority in the general election.
No polls have been published since the attack, but political analysts say the anti-Pakistan wave has become a rallying point for the BJP.
Yogendra Yadav, a former pollster and now a political activist, said the Kashmir attack would be a distraction from economic challenges facing the government.
"Ever since those issues have emerged, there have been systematic attempts to divert attention, some by design, some by accident," he said.
"The consequence (of the attack) would be to bring the spotlight on issues of national security, which is exactly what the ruling party may have wanted."
The BJP has not lost time in underlining its nationalist credentials. Addressing a political rally on Sunday, party president Amit Shah ended a brief period of bipartisan politics by saying that Modi was better at responding to militant attacks than the previous government headed by Congress.
"This time it's not a Congress government that is in power. The BJP government of Narendra Modi does not do any compromise in matters of national security," Shah said to loud cheers.
"The BJP government will completely uproot terrorism. Narendra Modi's political will to finish terrorism is the highest among global leaders."
Mamata Banerjee, chief minister of West Bengal state and an outspoken critic of Modi, has lashed out at the BJP comments.
"We didn't raise any questions (about the attack) because we thought we will be united in the fight (against terror)," she told reporters. "But now we see that we are silent and they are giving such speeches that it seems only they are patriots and the rest are outsiders."
Modi has often spoken about adopting a more muscular approach to Pakistan after a surprise visit to the neighbour in 2015 failed to improve ties.
BJP spokesman Nalin Kohli declined to say if the response to the attack would be an election issue for the party. But he defended party chief Shah's comments as a reflection of the "national mood of grief and anger".
In 2016, Indian forces carried out what they called a "surgical strike" on militant targets across the border in Pakistan in retaliation to an attack on an army camp in Kashmir.
Earlier this month, before last week's attack, Modi said the strike had "shown to the world what will be the new policy and culture in India".
On Monday, he said any hesitation to take action against militancy and those who support it was akin to encouraging the menace.
"Terrorism is a very serious threat to global peace and stability," Modi said. "The brutal terrorist attack shows that the time for talks is over."