Indian soldiers killed four militants during a two-day gun battle near the heavily militarised de facto border in Kashmir that divides the disputed territory with Pakistan, officials said on Monday.
Police said civilians tipped them off on Saturday about the movement of armed militants near the Line of Control (LoC), prompting a search.
Three of the militants were killed Sunday at three different locations, including at a mosque, a police statement said.
"With killing of all the three terrorists who appear to be Pakistanis, a major terrorist attack was averted," the statement added.
Indian army spokesman Colonel Rajesh Kalia said Monday that a fourth militant was killed during the continuing search operation of the area.
Four civilians and a soldier were wounded during the shootouts.
Kashmir has been divided between India and Pakistan since the end of British colonial rule in 1947 but both claim the territory in full.
Rebel groups have fought for decades roughly 500,000 Indian soldiers deployed in the territory, demanding independence or a merger of the former Himalayan kingdom with Pakistan.
Tens of thousands, mostly civilians, have died in the fighting.
New Delhi accuses Pakistan of training and pushing armed militants across the LoC to launch attacks on Indian forces.
Islamabad denies the allegations, saying it only provides diplomatic support for the Kashmiri struggle for right to self-determination.