Pakistani Prime Minister Nawaz Sharif accused nuclear-armed rival India on Wednesday of putting unacceptable conditions on dialogue and said the world would ignore rising tension in South Asia at its peril.

Sharif told the annual United Nations General Assembly Pakistan could not ignore India’s “unprecedented” arms build-up and would “take whatever measures are necessary to maintain credible deterrence”.

India has accused Pakistan of being behind a deadly attack on an army base in the disputed Kashmir region on Sunday in which 18 soldiers were killed and said it had the right to respond when and where it chose.

Pakistan has rejected the allegation and accused India of apportioning blame before the incident had been investigated properly.

Talks are in the interests of both countries. They are essential to resolve our differences ... and to avert the danger of any escalation

Pakistani Prime Minister Nawaz Sharif

Sharif said Pakistan wanted peace with India and had repeatedly offered dialogue.

“But India has posed unacceptable preconditions to engage in dialogue,” he said.

“Talks are in the interests of both countries. They are essential to resolve our differences, especially the Jammu and Kashmir dispute, and to avert the danger of any escalation.”

India has long accused Pakistan of playing a role in the 27-year-long insurgency against its rule in Jammu and Kashmir, its only Muslim-majority state. Pakistan denies sending fighters into Indian-administered Kashmir.

India has said it would only discuss terrorism-related issues, whereas Pakistan wants a wider agenda that would, among other things, discuss the Kashmir question.

Kashmir, divided between India and Pakistan since 1947, is at the heart the neighbours’ seven decades of distrust. Two of their three wars since independence from Britain have been fought over the region.

India’s portion of Kashmir has been under a major security lockdown during more than two months of protests sparked by the July 8 killing by Indian security forces of Burhan Wani, a popular young commander of the Kashmiri separatist group Hizbul Mujahideen, whose leader is based in Pakistan.

What we see in Pakistan ... is a terrorist state, which channelises billions of dollars, much of it diverted from international aid, to training, financing and supporting terrorist groups as militant proxies against it neighbours

Eenam Gambhir, India’s envoy to UN

Sharif praised Wani as “as the symbol of the latest Kashmiri Intifada, a popular and peaceful freedom movement”, drawing an immediate response from the Indian foreign ministry.

“The international community ignores the dangers of rising tensions in South Asia at its own peril,” he said.

India rejected Sharif’s remarks in a statement to the UN General Assembly from Eenam Gambhir, a senior diplomat at its UN mission.

“It is ironical ... that we have seen today the preaching of human rights and ostensible support for self-determination by a country which has established itself as the global epicentre of terrorism,” she said.

Sunday’s attack was “part of a trail of continuous flow of terrorists trained and armed by our neighbour” and tasked to carry out attacks in India, she said.

“What we see in Pakistan ... is a terrorist state, which channelises billions of dollars, much of it diverted from international aid, to training, financing and supporting terrorist groups as militant proxies against it neighbours,” she said.