The deceased was identified as Yeasin Mollah, 22, son of Mony Mollah of Wireless Para in the town. He was wanted in three criminal cases.
On December 12, Yeasin took 14-year-old Fatema from the Rajendra College ground. She was found dead near Telegram office the following day.
Police identified Yeasin from surveillance camera footage and arrested him on Sunday night, said Belal Hossain, sub-inspector of Kotwali Police Station.
Later, a team of police along with Yeasin conducted a drive in the area around 2am.
At one stage, the associates of Yeasin opened fire on police to snatch away the accused, triggering a gunfight, SI Belal said.
Yeasin was caught in the line of fire and suffered gunshot wounds. Later, he was taken to the local hospital where doctors pronounced him dead.
Three policemen were also injured in the incident, the SI said.