India's army says it has carried out "surgical strikes" against suspected militants along the de-facto border with Pakistan in Kashmir.
The operation was aimed at preventing attacks being planned by Pakistan-based militants, a senior army official said.
He said "significant casualties have been caused to the terrorists and those who are trying to support them".
Pakistan denies India carried out any strikes and says two of its soldiers were killed in cross-border shelling.
"The notion of surgical strike linked to alleged terrorists' bases is an illusion being deliberately generated by India to create false effects," the Pakistani military said in a statement.
Pakistan said its soldiers died in "unprovoked" firing along the Line of Control (LoC)dividing the disputed region.
A territorial dispute between the two countries over Muslim-majority Kashmir has been running for decades, but tensions flared earlier this month after a militant attack on an Indian army base in Kashmir left 18 soldiers dead.
India blamed the attack on Pakistan, which denied the claim.
The operation is thought to have taken place in the early hours of Thursday. Later, Pakistan captured an Indian soldier in a village in the Goi sector on the Pakistani side of the LoC.
"One soldier from 37 Rashtriya Rifles with weapons has inadvertently crossed over to the Pakistan side of the Line of Control," said a statement from an Indian army official in Delhi.
What do we know about the 'strikes'?
India's military gave few details of the operation it says it carried out overnight.
At a joint press briefing by the army and the foreign ministry, officials said the "motive of the operation was to hit out at terrorists who were planning to infiltrate into our territory".
India's Director General of Military Operations, Lt Gen Ranbir Singh, also blamed Pakistan for "being unable to control terror activities in territories under its control".
"Based on receiving specific and credible inputs that some terrorist teams had positioned themselves at launch pads along the Line of Control to carry out infiltration and conduct terrorist strikes inside Jammu and Kashmir and in various metros in other states, the Indian army conducted surgical strikes at several of these launch pads to pre-empt infiltration by terrorists," a statement said.
It said the "surgical strikes" had caused "significant damage to terrorists".
But the army did not say whether troops had entered Pakistan-administered Kashmir or had fired across the border.
If Indian troops did cross the LoC it would be a serious escalation between the two nuclear-armed neighbours.
However, the Press Trust of India quoted sources saying the operation took place between midnight and 04:30 local time on Thursday, that it was a combination of helicopter and ground forces, and seven militant "launch pads" had been targeted.
Some unconfirmed Indian media reports said more than 30 militants had been killed in the operation.
Pakistani army officials said the fighting started in the early hours of Thursday morning and continued for about six hours.
Narendra Modi's BJP government swept to power promising a tough line on Pakistan, so it has been been under tremendous pressure to retaliate after the 18 September attack on the army base in Uri in Indian-administered Kashmir. The raid was the deadliest of its kind for years.
"I assure the nation that those behind this despicable attack will not go unpunished," Mr Modi declared just hours after the base was attacked.
There was also much talk of whether India should continue with its doctrine of "strategic restraint" against Pakistan.
A "strike" now is seen by many observers as aimed at placating an angry domestic constituency and sending out the message that Mr Modi is a strong leader.
What does Pakistan say?
The country's prime minister, Nawaz Sharif, criticised the "unprovoked and naked aggression of Indian forces" and said his military was capable of thwarting "any evil design to undermine the sovereignty of Pakistan".
Islamabad says India's stance is a "blatant attempt" to deflect attention from human rights abuses in the region.
More than 80 people, nearly all anti-government protesters, have died in more than two months of violence against Indian rule.
What about India? By Soutik Biswas
The response in India has been predictably supportive of the army.
#ModiPunishesPak was trending top of Twitter in India, hours after the media first reported "the strikes". The other top trending hashtags included #SurgicalStrike and #Indian Army. A Narendra Modi fan club account tweeted a clip from a Tom and Jerry cartoon film to show India spanking Pakistan.
Government supporters gushed that this was a "proud moment for India", with one Bollywood actor thanking the army for doing what India "should have done 30 years ago".
A clutch of news channels were waxing delirious on how India had taught Pakistan a lesson and speculated endlessly about the details of the operation.
Things were much more serious between the two nuclear-armed rivals, they say, after the 2001 attack by Pakistan-based militants on the Indian parliament but there was no social media then, and the calls to escalate the conflict were more muted.
Why is Kashmir so dangerous?
Both India and Pakistan claim Muslim-majority Kashmir in its entirety but control only parts of it.
The territorial dispute between the two countries has been running for over six decades, and two out of the three wars fought between the nuclear-armed rivals have been over Kashmir.
As with every stand-off in Kashmir, the fear of many is that this could eventually escalate into a major clash between two nuclear-armed states.
But most analysts still believe that is unlikely to happen and that sporadic clashes and diplomatic sabre-rattling are likely to continue.