NEW DELHI — Indian Prime Minister Narendra Modi broke his silence Friday on the most dangerous clash between India and Pakistan in decades, saying he had begun a new era where India “will no longer be helpless in the face of terror” and casting his critics as foes of the nation.

Modi’s remarks, delivered at an election rally in Tamil Nadu, marked his first direct comments on days of tit-for-tat airstrikes that raised fears that the two nuclear-armed neighbors were stumbling into a broader war.

The tensions ratcheted down considerably on Thursday after Pakistan said it would return an Indian fighter pilot it had captured a day earlier in an aerial dogfight, the first between the two countries since 1971. Late Friday afternoon, the Indian pilot, Abhinandan Varthaman, was returned home to a hero’s welcome.

For Modi, who is seeking reelection in polls expected this spring, the confrontation with Pakistan over the militant groups within its borders is a rare political opportunity. Last month, it appeared India’s elections would be fought on terrain unfavorable to Modi, with issues like youth unemployment and rural distress near the top of the agenda.

Now the focus has shifted to an arena where Modi has the upper hand: national security. After 40 Indian paramilitary personnel were killed in a suicide bombing Feb. 14 in Kashmir — the deadliest militant attack in three decades of insurgency — Modi vowed to respond. 

That response came Tuesday, when India launched airstrikes on what it said was a training camp run by Jaish-e-Muhammad, the terrorist group that claimed responsibility for the Feb. 14 attack. India said the strikes “eliminated” large numbers of militants but has provided no proof. Satellite imagery of the site has undermined India’s claims that it hit its intended target and caused serious casualties.

At the rally on Friday, Modi said criticizing the Indian government’s handling of the strike was tantamount to aiding its archrival Pakistan. “The world is supporting India’s fight against terror but a few parties suspect our fight against terror,” Modi said. Such “statements are helping Pakistan and harming India . . . I want to ask them: Do you support our armed forces or suspect them?”

India’s armed forces have been more measured in their assessment of Tuesday’s strike than government officials. There was “fairly credible” evidence that showed damage to a Jaish-e-Muhammad training camp, Air Vice Marshal R.G.K. Kapoor told reporters Thursday, adding it would be “premature” to discuss the number of casualties. “We have got the effect that we desire.”

Regardless of the precise impact of the strike, Indian voters may agree. The fact that India used air power inside Pakistan for the first time since 1971 — rather than just inside the disputed region of Kashmir — represents a satisfying escalation for those long frustrated by what they consider Pakistan’s lack of action against militant groups inside its borders.

“Look how Modi has taught them a lesson,” said Shivam Jha, 19, a student at Delhi University, expressing a common sentiment here. Jha will be voting for the first time in the next elections and said Modi had his vote. “I am sure he is going to win.”

India’s airstrike within Pakistan on Tuesday was met with broad approval across the political spectrum. But the mood began to shift after Pakistan conducted a retaliatory strike on Wednesday in Indian-controlled Kashmir and an Indian fighter jet was shot down in the ensuing confrontation. Modi’s opponents slammed him for continuing with campaign-related activities in the middle of the crisis and for saying nothing about Varthaman, the captured pilot.

Modi cannot “leave aside his public relations exercise for even five minutes,” said Rahul Gandhi, the leader of the main opposition Congress Party, on Friday. Akhilesh Yadav, the leader of the regional Samajwadi Party, noted Thursday that Modi had said nothing about India’s pilot even though a full day had passed since his capture. “We’re all waiting with [bated] breath but not a word from our leadership,” Yadav wrote on Twitter. “The silence is deafening.”

Still, amid the euphoria around Varthaman’s release, it is unclear whether such criticism will stick. Modi has “reinforced his image as somebody who is not going to compromise as far as national security issues are concerned,” said Nilanjan Mukhopadhyay, a Modi biographer. “It puts the entire opposition on the defensive. Now criticizing his handling of the crisis would be presented [by his party] as being anti-India.”

Some voters say they see an electoral rationale in Modi’s decision-making but still approve of his choice. Modi went ahead with the airstrike “to get votes in the upcoming elections,” said Sanjay Kamat, 34, who works as cook in Delhi. “But it is ultimately good for the country.”

Tania Dutta contributed reporting.