Gunmen opened fire on Monday on a riverside military encampment in eastern Pakistan, an area where violence is rare, killing six soldiers and a policeman, the military said in a statement.
Thousands of supporters of hardline Islamist groups had, on the eve of the attack, passed through the area north of Lahore, capital of Punjab province, but officials said there was no evidence linking their presence to the attack.
"A small rescue party had camped on the bank of (a) river to search for the body of a drowned/missing pilot," the military statement said.
"Today, early morning, a few unknown assailants opened fire on the rescue party, which resulted in the shahadat (martyrdom) of six security forces personnel."
Police said the gunmen had arrived aboard a car and two motorcycles at the scene in Wazirabad, 100 km (60 miles) north of Lahore, and had fled after the shooting.
Supporters of the hardline Defence of Pakistan Council had moved through the area overnight on their way to Pakistan's capital Islamabad to protest against the reopening of overland supply routes to U.S.-led NATO troops in Afghanistan.
The march to the capital is being staged by the Council, an alliance of religious political parties and organisations, as part of a drive to break ties with the United States and India.
Pakistan suspended the supply routes last November after a cross-border Nato air attack killed 24 Pakistani soldiers. They were reopened last week after U.S. Secretary of State Hillary Clinton apologised for the strike.
"The Defence of Pakistan Council's supporters passed through the area some time before the attack, but linking the two is speculation at this point," police official Nadeem Abbas told Reuters in the town of Gujrat, near the scene of the attack.
Such attacks are more common in northwest Pakistan, home to several militant groups, including the Taliban, but rare in Punjab, a relatively affluent part of the country. Some extremist groups are based in the poorer southern part of Punjab, but are not known to attack security forces.
Pakistani security officials said they had started an investigation. No group had claimed responsibility.
"There are criminal groups active in the area, they could be involved. Or it could be militants, which could be a serious development," a senior Pakistani security official told Reuters. "We are not ruling anything out."