SRINAGAR, India — Indian and Pakistani troops fired at each other in disputed Kashmir on Monday, as Indian troops searched an army camp elsewhere in the region where suspected militants killed an Indian paramilitary soldier.

The exchange of gunfire lasted about five hours and caused no casualties, according to an Indian army officer who spoke on condition of anonymity because he was not authorized to speak to media. The army said earlier that Pakistani troops had fired without provocation using small arms and mortar shells in the Poonch sector of the Line of Control separating the Indian- and Pakistani-controlled parts of Kashmir.

Pakistan’s army said in a statement that its troops were responding to unprovoked firing by Indian soldiers.

In Islamabad, Prime Minister Nawaz Sharif met with the leaders of all Pakistani political parties to discuss the ongoing clashes.

“Our aim is to bring all political parties on one page,” Sharif’s aide and lawmaker Talal Chaudhry said on Pakistani TV channels. “We want to send a message to the world that we’re one against any threat to the country, irrespective of our political differences.”

Pakistani political parties hailed an offer by the United Nations last month to send a fact-finding team to review the situation in Indian-controlled Kashmir, a move that India has rejected.

The Indian army camp that was attacked late Sunday in the garrison town of Baramulla is the local headquarters of a counterinsurgency military unit.

Police officer Syed Javeid Mujataba Gillani said it was not immediately known whether the militants tried to enter the camp during their attack, which killed one soldier and wounded another. The town is 50 kilometers (30 miles) northwest of Srinagar, the main city in the portion of Kashmir controlled by India.

Sunday’s attack came three days after the Indian army said it had destroyed “terrorist launching pads” used by militants with support from Pakistan. Islamabad denies India’s accusations it arms and trains the insurgents, saying it offers moral and diplomatic support to Kashmiris.

In another deadly attack in Kashmir last month, suspected rebels sneaked into the army base in the town of Uri and killed 18 Indian soldiers.

Kashmir is divided between India and Pakistan, which have fought two wars for control of the Himalayan territory since British colonialists left in 1947.

Shahzad wrote from Islamabad.