SRINAGAR, India - Suspected rebels using guns and grenades sneaked into a crucial army base in Indian-controlled Kashmir early Sunday and killed at least 17 soldiers in the deadliest attack on a military base in the disputed Himalayan region in recent years, the army said.

Four rebels were killed as the soldiers returned gunfire after the surprise assault before dawn on the base close to the highly militarized Line of Control dividing Kashmir between India and Pakistan.

Loud explosions were heard and several barracks caught fire in the initial hours of the attack. Afterward, military helicopters hovered over the base as the army conducted what it described as “mopping up” operations.

Get Breaking News Delivered to Your Inbox

The casualties were high because a large number of soldiers were turning over the base to new units and were stationed in tents and temporary shelters that caught fire in the attack, the army said in a statement. The base, located in the town of Uri, west of Indian-controlled Kashmir’s main city of Srinagar, houses the Indian army’s brigade headquarters in the region along the de facto border.

Soldiers were conducting searches in the area, but army officials said it appeared that no more than four rebels were involved in the attack.

Army officials said the rebels had infiltrated into the Indian side of Kashmir from the Pakistani-controlled part.

The officials said the rebels entered the sprawling camp after crossing a stream and breaching the fencing Saturday night.

What made Sunday’s attack different from other attacks in the region was that instead of storming into the camp, the rebels quietly entered the base and later launched their attack, said a senior army officer who spoke on condition of anonymity because he was not authorized to speak to reporters.

Officials said at least 30 soldiers were wounded in the attack, including about a dozen who were in critical condition.

Indian Prime Minister Narendra Modi condemned the attack and tweeted, “I assure the nation that those behind this despicable attack will not go unpunished.”

Indian Home Minister Rajnath Singh called an emergency meeting of top defense officials and blamed Pakistan for the attack. “I am deeply disappointed with Pakistan’s continued and direct support to terrorism and terrorist groups,” he tweeted.

Kashmir is divided between India and Pakistan, but is claimed by both in its entirety. Most people in the Indian-controlled portion favor independence or a merger with Pakistan. A militant uprising and subsequent army crackdown since 1989 have killed more than 68,000 people.

India accuses Pakistan of training the militants in its territory then helping them to infiltrate into the Indian side. Islamabad denies the charge, saying it only gives political and diplomatic support to the rebels.

The attack came with Kashmir in middle of the largest anti-India protests against Indian rule in recent years since the July 8 killing of a popular rebel commander by Indian troops. A sweeping military crackdown and near-constant curfew have followed.

Protesters throwing rocks have clashed with troops firing live ammunition and shotgun pellets, and more than 80 people have been killed.

The last major attack on an Indian military installation was in January, when six gunmen entered an air force base in the town of Pathankot in the state of Punjab. The rebels managed to paralyze the massive base for nearly four days, killing seven soldiers. That base also is close to India’s border with Pakistan.