Security personnel sealed all the entry and exit routes of the area and zeroed-in on the area where militants were hiding, the official said.
The civilian, identified as 60-year-old Bashir Ahmad from Srinagar, was travelling in an Alto car along with his three-year-old grandson.
A police official said the encounter began after security forces launched a cordon and search operation in the area following inputs about the presence of militants there.
The gunbattle ensued when a joint team of Army and J&K police launched a search operation in Chanjimulla Handwara area after receiving inputs about presence of two militants there.
Army officers Col Ashutosh Sharma and Major Anuj, and Jammu and Kashmir Police Sub-Inspector Shakeel Qazi were among the deceased.
Four unidentified terrorists were killed in a shootout with security forces on Sunday morning in Anantnag district.
The killed terrorist group was involved in a series of terror acts, including the killing of civilians, setting a truck on fire in November 2019.
The security forces have recovered arms and ammunition from the site of encounter.