T HE ARMIES of India and Pakistan often exchange fire across the front line in the disputed state of Kashmir. When tensions rise, one side will subject the other to a blistering artillery barrage. On occasion, the two have sent soldiers on forays into one another’s territory. But since the feuding neighbours tested nuclear weapons in the late 1990s, neither had dared send fighter jets across the frontier—until this week. After a terrorist group based in Pakistan launched an attack in the Indian-controlled part of Kashmir that killed 40 soldiers, India responded by bombing what it said was a terrorist training camp in the Pakistani state of Khyber Pakhtunkhwa. Pakistan retaliated by sending jets of its own to bomb Indian targets. In the ensuing air battle, both sides claim to have shot down the other’s aircraft, and Pakistan captured an Indian pilot.

A miscalculation now could spell calamity. The fighting is already the fiercest between the two countries since India battled to expel Pakistani intruders from high in the Himalayas in 1999. The initial Indian air raid struck not Pakistan’s bit of Kashmir, but well within Pakistan proper and just 100km from the capital, Islamabad. That, in effect, constituted a change in the rules of engagement between the two (see article). India and Pakistan are so often at odds that there is a tendency to shrug off their spats, but not since their most recent, full-blown war in 1971 has the risk of escalation been so high.

The intention of Narendra Modi, India’s prime minister, in ordering the original air strike was simple. Pakistan has long backed terrorists who mount grisly attacks in India, most notably in Mumbai in 2008, when jihadists who arrived by boat from Pakistan killed some 165 people. Although Pakistan’s army promised then to shut down such extremist groups, it has not. By responding more forcefully than usual to the latest outrage, Mr Modi understandably wanted to signal that he was not willing to allow Pakistan to keep sponsoring terrorism.

In the long run, stability depends on Pakistan ending its indefensible support for terrorism. Its prime minister, Imran Khan, is urging dialogue and, in a promising gesture, was due to release India’s pilot—presumably with the approval of the army chief, who calls the shots on matters of security.

But in the short run Mr Modi shares the responsibility to stop a disastrous escalation. Because he faces an election in April, he faces the hardest and most consequential calculations. They could come to define his premiership.

Mr Modi has always presented himself as a bold and resolute military leader, who does not shrink from confronting Pakistan’s provocations. He has taken to repeating a catchphrase from the film “Uri”, which portrays a commando raid he ordered against Pakistan in 2016 in response to a previous terrorist attack as a moment of chin-jutting grit. The all-too-plausible fear is that his own tendency to swagger, along with domestic political pressures, will spur him further down the spiral towards war.

The ambiguity of Mr Modi’s beliefs only deepens the danger. He campaigned at the election in 2014 as a moderniser, who would bring jobs and prosperity to India. But, his critics charge, all his talk of development and reform is simply the figleaf for a lifelong commitment to a divisive Hindu-nationalist agenda.

Over the past five years Mr Modi has lived up neither to the hype nor to the dire warnings. The economy has grown strongly under his leadership, by around 7% a year. He has brought about reforms his predecessors had promised but never delivered, such as a nationwide goods-and-services tax ( GST ).

But unemployment has actually risen during Mr Modi’s tenure, according to leaked data that his government has been accused of trying to suppress (see article). The GST was needlessly complex and costly to administer. Other pressing reforms have fallen by the wayside. India’s banks are still largely in state hands, still prone to lend to the well-connected. And as the election has drawn closer, Mr Modi has resorted to politically expedient policies that are likely to harm the economy. His government hounded the boss of the central bank out of office for keeping interest rates high, appointing a replacement who promptly cut them. And it has unveiled draft rules that would protect domestic e-commerce firms from competition from retailers such as Amazon.

By the same token, Mr Modi has not sparked the outright communal conflagration his critics, The Economist included, fretted about before he became prime minister. But his government has often displayed hostility to India’s Muslim minority and sympathy for those who see Hinduism—the religion of 80% of Indians—as under threat from internal and external foes. He has appointed a bigoted Hindu prelate, Yogi Adityanath, as chief minister of India’s most populous state, Uttar Pradesh. A member of his cabinet presented garlands of flowers to a group of Hindu men who had been convicted of lynching a Muslim for selling beef (cows are sacred to Hindus). And Mr Modi himself has suspended the elected government of Jammu & Kashmir, India’s only Muslim-majority state, and used force to suppress protests there against the central government, leading to horrific civilian casualties.

As reprehensible as all this is, the Hindu zealots who staff Mr Modi’s electoral machine complain that he has not done enough to advance the Hindu cause (see article). And public dissatisfaction with his economic reforms has helped boost Congress, the main opposition party, making the election more competitive than had been expected. The temptation to fire up voters using heated brinkmanship with Pakistan will be huge.