The deceased was identified as Belal Hossain Dafadar, 39, a resident of Sitakunda upazila. He was wanted in 14 cases including ten rape cases.
Tipped off, a team of police conducted a drive in the area on Wednesday night and arrested Belal, said Bijoy Basak, deputy commissioner of Chattogram Metropolitan Police (CMP).
Later, police along with Belal conducted a drive in a hill near Shantinagar Residential area in the dead of night.
As soon as police reached the area, the associates of Belal opened fire on the law enforcers, forcing them to fire back that triggered a gunfight.
At one stage, Belal was caught in the line of fire and died on the spot.
Police also recovered some bullets and arms from the spot.
In 2016, local people caught Belal red-handed while abducting a child and handed him over to police.
Later, he got released from jail after securing bail.
Recently eight children in Bayazid Bostami, Akbar Shah and Khulshi areas of the city were violated.
During investigation, police came to know that Belal used to pick up minor girls alluring them of giving chocolates and violated them.
Two cases were filed with Bayazid Police Station, said Priton Sarkar, officer-in-charge of the police station.