The deceased were identified as Mohamamd Ismail, 28, son of Sultan Ahmed and Helal Uddin, 20, son of Abu Syed. Both of them were residents of Unchiprang Rohingya camp in Teknaf upazila.
Tipped off, a team of BGB-34 challenged a group of people while they were trying to enter the area around 5 am, said BGB commanding officer Lieutenant Colonel Ali Haider Azad Ahmed.
Sensing danger, the criminals opened fire on the BGB team, forcing them to fire back that triggered the gunfight.
Two Rohingya men suffered bullet wounds during the firing and they were taken to Ukhiya Health Complex where doctors declared them dead.
The BGB men also recovered 20,000 Yaba pills, one gun and two cartridges from the spot.
Abul Mansur, officer-in-charge of Ukhiya Police Station, said the bodies were sent to Sadar Hospital for autopsy.