On 27 July, three militants crossed from Pakistan into the Indian state of Punjab, according to GPS sets they were carrying. They planted five IEDs on a railway track, targeted bus passengers and holed up in a police station in Gurdaspur 20km from the border, eventually killing seven Indians. The attackers were themselves killed by local police after a day's siege.

The Gurdaspur attack was important in several respect apart from the death toll: its location, its method and its timing.

The Line of Control, which divides Indian- and Pakistan-controlled portions of Kashmir, is at its most volatile in a decade, with intense cross-border firing. Separately, there have been a string of terrorist attacks in the Indian state of Jammu and Kashmir (eg. on 9, 15, 24, 25, and 29 July), and a jump in recruitment by militant groups since January. A militant attack might therefore have been expected there. But Punjab, which lies to the south, is a different matter. From the 1970s onwards, Punjab had faced another insurgency, by militant Sikh separatists. It was also partly backed by Pakistan, but it petered out in the mid-1990s. In June, Indian intelligence warned that radical Sikh groups abroad were becoming more active.

However, it turned out that the attackers were Muslim rather than Sikh.

The choice of Punjab could be motivated by two factors. First, militants might wish to demonstrate their reach beyond Kashmir into more 'normal' parts of India. Second, lax border security might have played a role. The 560km stretch of India-Pakistan border in Punjab is part of the undisputed 'international border' (Pakistan calls it the 'working boundary') rather than the disputed, and more volatile, LoC that divides Kashmir. Indian officials have suggested that drug cartels operating on that border, some connected to Pakistani intelligence as well as to Indian border and state officials, might have helped with the militants' safe passage. Punjab faces a serious narcotics problem, with 361kg of mainly Afghan heroin reportedly recovered along the border last year and 125kg so far this year. Smugglers' use of Pakistani SIM cards, gaps in electric fencing caused by monsoon floods and tall grass all complicate enforcement.

India's Border Security Force (BSF) is now reviewing 38 vulnerable border points and 150 local people suspected of involvement in drug trafficking. The irony is that a state which allegedly didn't experience a single infiltration attempt for a whole decade (1996-2006) should now be a source of greater concern than Kashmir, where the infiltration has fallen from 97 crossings in 2013 to 65 last year to zero this year, according to Indian Army data.

The attack also underscores more familiar vulnerabilities in India's counter-terrorism capabilities.

KPS Gill, a former director of police in the Punjab, renowned for his central role in curbing the insurgency, wrote a scathing column for the Indian Express pointing to a woeful lack of equipment and training for local police. The same newspaper noted that Punjab police had been trained by Israeli specialists four years ago but that funding dried up, leaving police firing 'a handful of rounds for practice' every year, SWAT teams walking around a live siege without bulletproof vests or helmets, turf wars between local and federal forces, and no back-up for two hours. Seven years after the Mumbai attacks, India's ability to respond quickly and effectively to major attacks remains under serious question.

The other important aspect of the Gurdaspur attack is the timing. Three weeks ago, on 10 July, Prime Minister Narendra Modi met with his Pakistani counterpart Nawaz Sharif on the sidelines of the Shanghai Cooperation Organization (SCO) meeting in Ufa, Russia. Having suspended talks with Pakistan last year over a relatively routine Pakistani meeting with Kashmiri separatists, Modi announced he would in fact travel to Pakistan for next year's South Asian Association of Regional Cooperation (SAARC) summit and, moreover, that his hawkish National Security Advisor, Ajit Doval, would meet with his Pakistani counterpart Sartaj Aziz.

Despite New Delhi's obvious U-turn, prompting an 'I told you so' from several analysts, Indian officials were cock-a-hoop because India's core concern (terrorism) was explicitly mentioned in the joint briefing while Pakistan's (Kashmir) was not. This was followed by irritation and outrage at home in Pakistan, a shot of tetchy clarification by Aziz on 11 July, a kerfuffle over an Indian drone and Pakistani border firing on 15 July, and repeated Pakistani suggestions that they will raise (unsubstantiated) allegations of Indian-backed terrorism both with India and at the UN. On Eid, 18 July, Pakistani soldiers on the border symbolically refused to accept traditional celebratory sweets from their Indian counterparts.

This is the febrile context to Gurdaspur. Bilateral relations are in severe flux, with renewed contacts amid a backdrop of edgy tension. In the past, terrorist attacks have coincided with such phases of dialogue between India and Pakistan. The charitable interpretation is that terrorist groups wish to disrupt any process of rapprochement. The more cynical explanation is that 'rogue elements' in the Pakistani state, as The Hindu put it, share that aim. More cynical still, though borne out by precedent, is that the Pakistani military establishment itself, rather than mavericks, are the ultimate spoilers.

The veteran national security reporter Praveen Swami, for instance, claims that from the perspective of Pakistan's generals, 'New Delhi has no choice but to bear more pain in Kashmir'. The attackers' possession of night-vision equipment and a 60mm mortar might also point, circumstantially, to state sponsorship. Unnamed and unspecified 'sources' told India's Zee News that Pakistani intelligence had trained the attackers on the Thailand-Myanmar border for ten days, sources from India's Home Ministry specifically named the Pakistani-intelligence-backed group Lashkar-e-Taiba and the Economic Times says Indian intelligence agencies reported a 17 July meeting at which the Pakistani army gave 'clear instructions' to its border forces to encourage infiltration.

And yet, India's official response has been deliberately and significantly cautious. India's home minister himself admitted to parliament he didn't have 'credible evidence' linking the Pakistani state to the attack, and was careful in his language. More importantly, Indian officials have said the meeting of Indian and Pakistani national security advisers will go ahead, probably on 23 and 24 August.

A number of Indian analysts, though largely blaming Pakistan, have backed this approach. Nitin Pai  argued that India's 'most effective Pakistan policy is eight per cent economic growth'. The Indian Express urged Modi to 'shut his ears to the tweets of the hawks' and stick with the dialogue. The Hindu warned against 'knee-jerk reactions', commended 'the policy of engagement', and suggested an 'iron fist in a velvet glove'. Srinath Raghavan argued that talks should be routinised rather than treated as a reward for good behaviour.

Meanwhile, in the characteristic Punch and Judy style of Indian parliamentary politics, the opposition Congress Party issued puerile jeers at the Government, in response to which the home minister lashed out by highlighting Congress' own foreign policy failures (including highly topical examples such as a war with China that occurred 53 years ago) and suggesting, in dog-whistle fashion, that Congress' focus on 'Hindu terrorism'. Such is the feeble state of the national security debate among India's elected leaders.

Photo courtesy of Flickr user Austin Yoder.