"One BSF man has been killed and another injured," senior police superintendent of Baramulla, Imtiyaz Hussain Mir, told AFP, referring to the Border Security Force (BSF).
Mir said the rebels were not successful in breaching the perimeter of the camp, located inside the town, some 50 kilometres (34 miles) from occupied Srinagar.
The army said on Twitter the "incident" had been bought under control and firing had stopped, without saying whether any suspected militants had been killed or captured.
"Terrorists opened fire on an army camp in Baramulla town," Colonel Rajesh Kalia earlier told AFP. Local media quoted residents as saying that loud gunfire could be heard coming from the camp.