NEW DELHI — For the first time in five decades, Indian warplanes crossed into Pakistan and conducted airstrikes on Tuesday. But in the jarring escalation of hostilities, the leadership of each nuclear-armed country also appeared to leave itself a way out of pushing the conflict into war.

In India, where election-year nationalism is fueling waves of anger over the militant attack in Kashmir that killed dozens of soldiers this month, the story line was of righteous vengeance accomplished.

“We won’t let this country bow down!” Prime Minister Narendra Modi told a charged rally in New Delhi, speaking in front of a backdrop with the photos of the Indian soldiers killed by a suicide bomber.