India says it has conducted “surgical strikes” on suspected militants preparing to infiltrate from Pakistan-ruled Kashmir, making its first direct military response to an attack on an army base it blames on Pakistan.

Pakistan said two of its soldiers had been killed in exchanges of fire and in repulsing an Indian “raid”, but denied that India had made any targeted strikes across the de facto frontier that runs through the disputed Himalayan territory of Kashmir.

“The notion of surgical strike linked to alleged terrorists’ bases is an illusion being deliberately generated by India to create false effects,” Pakistan’s military said in a statement.

The cross-border action inflicted significant casualties, the Indian army’s head of operations told reporters in Delhi, while a senior government official said Indian soldiers had crossed the border to target militant camps.

The Indian announcement followed through on Prime Minister Narendra Modi’s warning that those in Delhi held responsible “would not go unpunished” for an 18 September attack on an Indian army base at Uri, near the Line of Control, that killed 18 soldiers.

The strikes also raised the possibility of a military escalation between nuclear-armed India and Pakistan that would wreck a 2003 Kashmir ceasefire. India evacuated people from some villagers near the front line as a precautionary measure.

Lt General Ranbir Singh, the Indian army’s director general of military operations (DGMO), said the strikes were launched on Wednesday based on “very specific and credible information that some terrorist units had positioned themselves ... with an aim to carry out infiltration and terrorist strikes”.

Lt General Singh said he had called his Pakistani counterpart to inform him of the operation.

Inside Story - What will it take to restore peace in Indian-administered Kashmir?

Pakistan’s military spokesman slammed the Indian account as “totally baseless and completely a lie”, saying the contact between DGMOs only included communication regarding cross-border firing, which was within existing rules of engagement.

“We deny it. There is no such thing on the ground. There is just the incident of the firing last night, which we responded to,” Lt General Asim Bajwa told news channel Geo TV.

“We have fired in accordance with the rules of engagement We are acting in a responsible way.”

Pakistan said nine of its soldiers had also been wounded. Neither side’s account could be independently verified.

India’s disclosure of such strikes was unprecedented, said Ajai Sahni of the Institute for Conflict Management in Delhi, and sent a message not only to his own people but to the international community.

“India expects global support to launch more focused action against Pakistan,” Mr Sahni told Reuters. “There was tremendous pressure on the Indian prime minister to prove that he is ready to take serious action.”

The border clash also comes at a delicate time for Pakistan, with powerful Army Chief of Staff General Raheel Sharif due to retire shortly and Prime Minister Nawaz Sharif still to decide on a successor.

The Pakistani premier condemned what he called India's “unprovoked and naked aggression” and called a cabinet meeting on Friday to discuss further steps.

India blames Pakistan for ‘supporting’ Kashmir base attack

Share markets in India and Pakistan fell on India’s announcement. India’s NSE index closed down 1.6 per cent after falling as much 2.1 per cent to its lowest since 29 August, while Pakistan’s benchmark 100-share index was down 0.15 per cent.

India announced its retaliation at a news conference in Delhi that was hurriedly called, only to be delayed, as Mr Modi chaired a meeting of his cabinet committee on security to be briefed on the operation.

“The prime minister is clear that this is exactly what we should have done,” a senior government official told Reuters on condition of anonymity. “Informing the world about the surgical strike was important today.”

US National Security Adviser Susan Rice spoke with her Indian counterpart, Ajit Doval, before news of the Indian cross-border operation broke, the White House said.

Ms Rice discussed deepening collaboration between the United States and India on counter-terrorism and urged Pakistan to combat and delegitimise individuals and entities designated by the United Nations as terrorists.

Exchanges of fire took place in the Bhimber, Hot Spring, Kel and Lipa sectors in Pakistan-administered Kashmir, and lasted about six hours, the Pakistani military said earlier.

An Indian army officer in Kashmir said there had been shelling from the Pakistani side of the border into the Nowgam district, near the Line of Control, and the exchange of fire continued during the day.

There were no casualties or damage reported on the Indian side of the frontier.

An Indian military source told Reuters that the operation was carried out on the Pakistani side of the Line of Control where there were between five and seven infiltration “launchpads”.

“It was a shallow strike. The operation began at around midnight and it was over before sunrise,” this source, who had been briefed by his superiors on the operation, said. “All our men are back. Significant casualties inflicted. Damage assessment still going on.”

A Pakistani military officer at Chhamb, near the Line of Control, contradicted the Indian version, saying the attack had been repelled. “They ran back, leaving may dead bodies on their side,” this senior officer said.

Both India and Pakistan claim Kashmir in full, but govern separate parts, and have fought three wars since independence from Britain in 1947, two of them over Kashmir.

Tension between the South Asian rivals has been high since an Indian crackdown on dissent in Kashmir following the killing by security forces of Burhan Wani, a young separatist leader, in July.

They rose further when Delhi blamed Pakistan for the Uri attack, which inflicted the heaviest toll on the Indian army of any single incident in 14 years.

India has been ratcheting up pressure on Pakistan, seeking to isolate it at the UN General Assembly in New York and winning expressions of condemnation from the United States, Britain and France over the attack.

China, another of the five permanent members of the UN Security Council and a traditional ally of Pakistan, has urged dialogue between the two antagonists.

On Wednesday, officials from several countries said a November summit of a the South Asian regional group due to be held in Islamabad may be called off after India, Bangladesh and Afghanistan said they would not attend.