The deceased was identified as Dudu Mia, son of late Sultan Ahmed of Nazirpara in the upazila.
Pradip Kumar Das, officer-in-charge of Teknaf Model Police Station, said police conducted a drive at Maheshkaripara around 3am along with Dudu Mia who was arrested earlier to recover Yaba pills and firearms.
As soon as police reached the spot, his cohorts opened fire aiming them, prompting them to shoot back triggering a gunfight.
At one stage, Dudu Mia was caught in the line of fire and received bullet injuries.
Later, he was taken to a local hospital where doctors declared him dead.
Assistant sub-inspectors Sanjib and Nizam Uddin and constable Ibrahim also sustained injuries in the gunfight, the OC claimed, adding that they recovered five locally made firearms, 13 bullets and 4,000 Yaba pills from the spot.