The deceased were identified as Moulvi Bakhtier alias Bakhtier Uddin, 55, member of Rajapalong Union and son of Kala Mia and Mohammad Taher, 27, son of Yusuf Ali of Kutupalong Rohingya camp.
They were wanted in several cases, according to police.
Pradeep Kumar Das, officer-in-charge of Teknaf Model Police Station, said police arrested Yunus with 20,000 Yaba pills from Hinla on Thursday night.
After interrogation, police came to know that a Rohingya man Taher was involved in illicit drug trade. Later, police arrested Taher.
According to Taher's information , police conducted a drive at the house of UP member Bakhtier and recovered 20,000 Yaba pills and Tk 10 lakh cash.
Police then conducted a drive in Hinla with Bakhtier and Taher to recover firearms and Yaba early in the morning.
When police reached the spot, the associates of the arrestees opened fire, triggering a skirmish.
Bakhtier and Taher were caught in the line of fire and sustained gunshot wounds during the gunfight while the others managed to flee.
Later, they were taken to Teknaf Upazila Health Complex where the doctors declared them dead.
Five policemen including Assistant Sub-Inspector Mazharul Islam were injured during the gunfight.
Five LG gun, Tk 10 lakh, 17 bullets and 40 pieces of Yaba pills were recovered from the spot.