Jasveer Singh died on the spot.
He was in the night duty yesterday at the Link Road residence of Hans here, Jalandhar police sources said.
"During the duty he tried to sit on the cot, meant for guards, with his AK-47 rifle. As soon as he sat, the trigger got pulled and 22 rounds of shots got fired. His fingers were on the trigger," they said.
The body has been sent for post-mortem and matter is being investigated, they said.
Jasveer, who hailed from Tarn Taran district, was posted as security guard for Hans for the past two years, police said.