The incident occurred in Mymensingh Sadar's Nizam Nagar area around 1.30 am on Sunday, according to Shah Kamal Hossain, the officer-in-charge of the district's DB.
The dead man was identified as Sajal Mia, 24, a resident of Mymensingh city's Kestopur.
Police launched a raid on being informed of a gathering of drug peddlers in Nizam Nagar, said the OC.
"Alerted to the presence of law enforcers, the drug peddlers opened fire on them, triggering a retaliation from the police team. At one point in the shootout, the drug peddlers fled, leaving the bullet-ridden Sajal behind."
Sajal was rushed to Mymensingh Medical College Hospital where the on-duty doctor declared him dead, said OC Shah.
Three knives and 100g of heroin were recovered from the scene while two policemen were injured in the gunfight, he added.