Indian soldiers patrol the Line of Control between India and Pakistan in 2013. India said it had conducted military strikes along its de facto border with Pakistan to thwart attacks. (Tauseef Mustafa/AFP/Getty Images)

Sporadic shelling broke out along India and Pakistan’s disputed border in Kashmir on Thursday after India said it conducted an anti-terrorism strike inside the section controlled by Pakistan — marking a significant rise in tension between the two nuclear-armed rivals.

India’s military said its soldiers had crept over the highly militarized border in darkness and struck at about half a dozen staging areas early Thursday where it said teams of militants were gathering, preparing to launch attacks both in the disputed Kashmir region and in unspecified cities across India.

Full details have yet to emerge, but such a strike would be the most aggressive military action from India toward Pakistan in years and could mark a shift in India’s strategytoward its neighbor, which it has long accused of harboring terrorist groups.

The countries offered sharply conflicting accounts of the day’s events, however, underscoring the heightened suspicions and volatility in an area that has been at the heart of India-Pakistan friction for decades.

In Pakistan, Prime Minister Nawaz Sharif condemned the “unprovoked and naked aggression of Indian forces” that resulted in the death of at least two Pakistani soldiers. India however, insisted that suspected militants numbering in the “double digits” were killed.

Pakistan’s military said it had captured an Indian soldier on its side of the border.

Evacuations were ordered in some villages on both sides of what is known as the Line of Control dividing Kashmir, in the shadow of the Himalayas.

Tensions have been running high between the two countries since four Pakistani militants attacked an army camp in the Indian border town of Uri on Sept. 18, killing 18 Indian soldiers. India has claimed that Pakistan supported the militants, and the director general of Indian military operations, Lt. Gen. Ranbir Singh, said Thursday that investigators uncovered global positioning systems and supplies that had Pakistani markings. Pakistan has denied involvement.

India and Pakistan, which have fought four wars, have both long laid claim to the disputed Kashmir region, and India has accused Pakistan of supporting an armed insurgency in the part that is administered by India.

Singh said that the military had received “specific and credible information” that terrorist teams had positioned themselves in staging areas along the Line of Control, intending to carry out terrorist attacks in the Kashmir region and in Indian cities.

The army responded with strikes that inflicted “significant casualties” on the “terrorists and their supporters,” Singh said. Indian government officials said their soldiers carried out operations more than a half mile across the line.

“We cannot allow the terrorists to operate across the Line of Control with impunity and attack citizens of our country at will,” Singh said.

Pakistan’s foreign ministry strongly denounced “unprovoked cease-fire violations” and warned that India has “deliberately escalated tension” in Kashmir.

“Our intent for a peaceful neighborhood should not be mistaken as our weakness,” Sharif said in a statement. “Our valiant forces are fully capable of defending the territorial integrity of the country.”

Abid Mir, a senior superintendent of police of Rawalakot, a city near the Line of Control, said India did not conduct a pinpoint operation against militants, and instead hit an army post with shelling. Mir accused New Delhi of “lying to hoodwink its people.”

Meanwhile, Indian and Pakistani troops exchanged heavy fire at different points in Jammu and Kashmir, triggering widespread fear among local residents, police said. Officials said they were bracing for possible retaliation by Pakistani forces.

A retired school principal, Qazi Hamidudin — a resident of Kandi Karnah village, near the Indian side of the border — said that many of his neighbors were considering leaving their homes and relocating to safer areas.

“The tensions between two countries could bring miseries for us,” he said.

Indian Kashmir has been beset by violent protests since July 8, when Indian forces killed a popular young militant commander named Burhan Wani, and more than 70 people have died. Hundreds more have been blinded and injured by Indian soldiers firing pellet guns.

On Saturday, Indian Prime Minister Narendra Modi gave a speech that many interpreted as a call for strategic restraint, and the government has been examining other diplomatic means of isolating Pakistan in recent days.

Those options include revisiting the terms of a decades-old water treaty and revoking Pakistan’s most-favored nation status as a trading partner. India has already pulled out of an upcoming regional meeting that was to be held in Islamabad in November, along with leaders of Bangladesh, Afghanistan and Bhutan.

U.S. officials have urged restraint. National security adviser Susan E. Rice spoke to her Indian counterpart, Ajit Doval, Wednesday to express her sympathy over the losses in the Uri attack and reiterate the U.S. expectation that Pakistan would take action to combat terrorist groups such as Lashkar-e-Taiba and Jaish-e-Muhammad operating on its soil. They did not discuss the counterterror operation, Indian officials said.

Friction between India and Pakistan has played out in small ways on the domestic front as well. In the past week, the producers association from India’s booming Bollywood film industry passed a resolution banning Pakistani actors and technicians from working in India until normal relations return. On the other side of the border, Pakistan has decided to not to show a new Indian movie that is a biopic of a famous Indian cricket player.

Hussain reported from Islamabad. Ishfaq Naseem in Srinagar, India, and Rama Lakshmi in New Delhi also contributed to this report.