Three Indian soldiers were killed in a terror attack Tuesday at an army artillery unit in the town of Nagrota near Jammu in the northern state of Jammu and Kashmir, just about 12 miles from the country’s border with Pakistan.

An alert was sounded in Jammu city after an army officer and two other personnel were killed in the gun battle that ensued after terrorists, reportedly four in all, stormed the 166 artillery unit, opening fire at the officers' mess in the town that serves as the headquarters of the army's 16 corps.

The terrorists reportedly positioned themselves inside the building, making it difficult to rescue family members of some officers stranded because of the gunfire. Reports said four militants were killed as search operations continue.

The army is expected to investigate how the attackers were able to access the highly fortified base, while the local highway close to the headquarters was blockaded.

“We have ordered closure of all schools and education institutions in Nagrota tehsil [a local administrative unit] in view of the terror attack,” Jammu’s Deputy Commissioner Simrandeep Singh said, according to Indian daily the Times of India.

In a separate incident, India’s Border Security Force intercepted a group of terrorists, killing three of them as they reportedly attempted to cross over from Pakistan into India in the Samba sector of Jammu and Kashmir, 35 miles southeast of Nagrota.

In September, terrorists attacked the Indian army base in Uri, Kashmir, killing 19 soldiers. India claimed the attacks were carried out by Pakistan-based militants, sparking retaliation from New Delhi in the form of reported “surgical strikes” across the line of control later in the month.

According to India, the strikes resulted in the killing of several militants but Pakistan denied any such raids took place, asking India to produce credible evidence to back its claim, a request India ignored.

The Tuesday attacks in Jammu occurred on the same day Pakistan’s new army chief, General Qamar Javed Bajwa, took charge from General Raheel Sharif. In his farewell speech, Sharif left a message for the neighboring country, saying: “Don't mistake our patience for weakness.”