The security personnel were attacked by a group of militants shortly after they had offered pre-dawn prayers.
The gunmen, who were using cars and motorcycles, fled after the shooting, TV news channels reported.
The military confirmed the incident in a brief statement.
It said seven security personnel, including a police official, were killed instantly and five others were injured "due to firing by unknown assailants near Wazirabad", a town located 12 km from Gujrat city.
One of injured personnel died later in hospital, TV news channels reported. The injured were taken to a military hospital in Gujranwala district.
The militants planted a timed explosive device near the security forces camp that went off shortly after the attack.
No one was injured by the explosion. The banned Tehrik-e-Taliban Pakistan claimed responsibility for the incident, Geo News reported.
The security personnel were part of a small rescue party that had camped on the bank of the Chenab river to search for the body of a pilot who drowned when a military helicopter crashed on May 23.
The attack occurred hours after thousands of supporters of the Defa-e-Pakistan Council arrived in Gujrat as part of a "long march" to protest the government's decision to reopen NATO supply routes to Afghanistan.
The DPC is an alliance of over 40 religious and extremist groups, including the Jamaat-ud-Dawah and the banned Sipah-e-Sahaba.
The DPC is opposed to the transportation of supplies for foreign troops in Afghanistan through Pakistani territory.
The supply routes were closed last November after a cross-border NATO air strike that killed 24 Pakistani soldiers.
The government reopened the supply lines last week after the US apologised for the NATO attack.
Islamabad: Militants attacked a security forces camp near the city of Gujrat in Pakistan's Punjab province on Monday, killing seven soldiers and a policeman and injuring several others.
First Published: Tuesday, July 10, 2012, 00:09