SUSPECTED militants infiltrated an Indian air force base near the border with Pakistan on Saturday and exchanged fire with security forces for hours, leaving at least four gunmen and two Indian troops dead, officials and news reports said.

Although it was unclear who staged the attack, it was being seen as a possible attempt to undo recent progress made in relations between rivals India and Pakistan, coming just a week after the first visit to Pakistan in 12 years by an Indian prime minister.

The attack at the Pathankot air force base began a couple of hours before dawn, and by late morning it appeared that the violence had ended with the killing of the gunmen by Indian forces. But just two hours later, fresh gunfire erupted, with an air force helicopter firing at an area of the base. Shots could also be heard from inside Pathankot, a major air force base located about 430 kilometers north of New Delhi.

Air force spokeswoman Rochelle D’Silva said Saturday night that troops were conducting combing operations of the entire base in order to be able to fully secure it. She added that the full number of casualties would be clear once the base was completely secured.

By 8pm local time, no gunfire had been heard around the base for more than two hours.

The defense ministry said there had been intelligence reports about a likely terror attack on military installations in Pathankot, and that the air force had been prepared to thwart any attackers.

“Due to the effective preparation and coordinated efforts by all the security agencies a group of terrorists were detected by the aerial surveillance platforms as soon as they entered the Air Force Station at Pathankot,” the ministry said in a statement.

Despite the intelligence on a possible attack, at least two air force troops were killed in the gunbattle, the Press Trust of India news agency reported. PTI, citing police, also said at least four gunmen had been killed.

The attack began at around 3 am, when a group of gunmen entered the section of the base where the living quarters are located, the defense ministry said. The attackers, however, were unable to penetrate the area where fighter helicopters and other military equipment are kept, it said.

Police said they suspected the gunmen were militants, and were investigating whether they had come from the Indian portion of Kashmir or from Pakistan. The Himalayan region of Kashmir is divided between India and Pakistan, but is claimed in its entirety by both.

Rebels routinely stage attacks in Indian-held Kashmir, where they’ve been fighting since 1989 for an independent Kashmir or its merger with Pakistan.

India accuses Pakistan of arming and training Kashmir’s insurgents, a charge Islamabad denies, and the attack was viewed by many in India as an attempt to unravel recent progress in the country’s relationship with its archrival.

The violence came just a week after Indian Prime Minister Narendra Modi made an unannounced visit to Pakistan to meet with his Pakistani counterpart, Nawaz Sharif. The visit was seen as a potential sign of thawing relations between the two nuclear-armed neighbors. The two leaders also held an unscheduled meeting at the Paris climate change talks last month.

Security deployed outside #Pathankot Air Force Station. (pictures deferred by unspecified time) pic.twitter.com/i7Bp9vR8zW — ANI (@ANI_news) January 2, 2016

Ahead of Modi’s visit to Pakistan, the national security advisers of both countries had met in Thailand. The foreign secretaries of both nations are scheduled to meet in Islamabad later this month.

In the past, the contentious issue of Kashmir has halted talks between the rivals.

Pathankot, in Punjab state, is on the highway that connects India’s insurgency-wracked Jammu and Kashmir state with the rest of the country. It’s also very close to India’s border with Pakistan.