Militants hurled a grenade, followed by firing, at security personnel who were on duty near the Degree College in Pulwama town, a police official said.
He said 18 security personnel including an additional SP, a DSP and a local SHO were injured in the attack.
Among the injured were eight CRPF personnel.
The militants fled from the spot after carrying out the attack.