The men were killed on Wednesday during fierce fighting through the night that ended when security forces just after 8am (0230 GMT) on Thursday gunned down a fighter who had stormed the camp in the Raj Bagh area of Srinagar about 12 hours earlier, Kashmir's police chief Gopal Sharma told reporters at the scene.
Four of the injured policemen were critical, doctors said.
"The operation has ended and we have recovered the body of a militant," the spokesman for India's Border Security Force (BSF) Neeraj Sharma said.
Security forces were searching the Central Reserve Police Force (CRPF) camp in case more than one fighter had been involved in the attack.
Shashi Nayak, a cook at the camp, and a rifleman were rescued by BSF troopers and police from the second floor of a concrete building at around 7am.
"It was a horrifying experience all through the night," said a pale and visibly shaken Nayak.
"We had exhausted
Had he succeeded in opening the door he would have killed us"
"The two of us bolted the door from the inside. But he [the attacker] continued to fire at the door but couldn't open it," he said, as he watched his colleagues trying to defuse a hand grenade recovered from the fighter.
"We had exhausted our ammunition. Had he succeeded in opening the door, he would have killed us," Nayak said.
He said he believed there were two attackers but that one of them managed to escape around midnight.
Two lesser-known groups, the al-Mansoorain and the al-Madina regiment, claimed responsibility for the attack in telephone calls to local media.
Al-Mansoorain claimed responsibility for a similar attack in July that killed five policemen and two fighters.
Sharma said violence usually went up ahead of India's independence day, celebrated on 15 August. Fighters and separatist politicians observe the event as a "black day".
"They always increase violence around republic and independence days," said Sharma.
He said the fighters were diverting their resources to Srinagar, which houses the offices and residences of all the top officials and politicians, including Chief Minister Mufti Muhammed Sayeed.
There have been tens of thousands of deaths since 1989 in the disputed Indian-administered Kashmir.