Indian army soldiers take shelter from rain during a curfew in Jammu, India, Wednesday.

ISLAMABAD — Deadly violence over the last week along the disputed Kashmir border between Pakistan and India threatens to sabotage recent efforts by the nuclear-armed rivals to improve ties, illustrating how vulnerable the normalization process is to spoilers from both sides.

The most dangerous of these potential spoilers are Islamic militants who have historically been nurtured by the Pakistani military to fight a covert war over Kashmir and may feel threatened by any indication the government is cozying up to India.

The Pakistani army and its militant proxies have a history of using violence to sabotage outreach to India by civilian leaders, and suspicion about the generals’ intentions still runs high in New Delhi.

But many Pakistani analysts believe the army’s leaders have little interest in rocking the boat now, raising the worrying possibility that the recent violence was sparked by militants who have gone rogue or are operating in cooperation with lower level military officials sympathetic to their cause.

“This has really pulled the rug from under the feet of Nawaz Sharif and Manmohan Singh,” the prime ministers of Pakistan and India, said Moeed Yusuf, a Pakistan expert at the United States Institute of Peace. Both leaders have expressed a desire to improve ties, especially to increase cross-border trade.

The U.S. is likely watching the current tension closely, both because of the nuclear arms on both sides and the spillover effect that conflict between the two countries has in neighboring Afghanistan. The U.S. has long suspected Pakistan of supporting Taliban militants in Afghanistan to counter Indian influence.

Majority Muslim Pakistan and predominantly Hindu India have fought three major wars since they both gained independence from Britain in 1947, two of them over Kashmir. The disputed territory is divided between the two countries but claimed in its entirety by both.

A 2003 cease-fire agreement has largely calmed the disputed border between the countries, although they occasionally accuse each other of violating it by firing mortars or gunshots, and several soldiers were killed on each side in January in cross-border attacks.

The latest round of violence began last Tuesday when, according to the Indian military, 20 heavily-armed militants and Pakistani soldiers crossed the Kashmir border and killed five Indian troops.

The Pakistani military has denied that its soldiers killed any Indian troops and accused Indian soldiers of killing a pair of civilians and wounding two others along the border over the last week.

The latest accusation came Wednesday when a Pakistani military official said Indian troops shelled the Battal sector of Pakistan-held Kashmir on Tuesday night, killing one civilian and seriously wounding another.

An Indian army officer denied the allegation, saying there was no shelling or exchange of gunfire in the sector. Both the Pakistani and Indian officials spoke on condition of anonymity in line with military policy.

Pakistan’s new prime minister, Sharif, took office in June with a pledge to improve relations with India to help turn around his country’s stuttering economy. Trade between the two countries is around $2 billion per year and could go as high as $11 billion once trade is normalized, according to some estimates.

Pakistani Finance Minister Muhammad Ishaq Dar indicated earlier this week that the government was backing off granting most favored nation trading status to India in the wake of the violence on the Kashmir border.