NEW DELHI — Tensions between India and Pakistan were raised again on Tuesday, when a group of heavily armed militants disguised as police officers attacked an Indian Army unit in the northern state of Jammu and Kashmir, killing seven soldiers, the Indian government said in a statement.

The assault began early Tuesday in the officers’ dining hall at Nagrota, about two miles from the army’s regional headquarters for the country’s northernmost state, which has been at the center of a nearly 70-year dispute with neighboring Pakistan.

After killing four soldiers there, the militants moved on to two other buildings, where they held hostage a group of 16 soldiers and relatives, including “two ladies and two children,” the statement said.

All of the hostages were rescued, the government said, but an officer and two soldiers were killed in the operation, along with three militants.