Nandail Police Station OC Md Ataur Rahman said Saiful Islam alias Don and another person died in hospital after they received bullet injuries in the gun battle on Thursday night.
Three RAB personnel were also injured, he added.
The OC could not identify the other person killed in the fire fight.
Quoting RAB officials, the OC said gunmen tried to snatch 'militants' from a RAB-14 patrol by spraying bullets and hurling bombs at Dangi village on Dhaka-Mymensingh Highway around 11:15pm.
Shafiul and the other person were hit by bullet, he said.
A RAB official at the scene said three pistols, four machetes, a cutter, a hammer and a bag were recovered.
He said the RAB personnel were on their way to hand Shafiul over to police.
The RAB Headquarters in a text message said three of its officials were wounded in the skirmish.
Two motorcycles, firearms, bombs and explosives were found at the scene, it said.
Shafiul also goes by the aliases Shariful Islam, Abu Mokaddel, and ‘Sohan’, according to police.
On the Eid-ul-Fitr morning of July 7, a police check-post near the Sholakia Eidgah ground, which hosts the country’s largest Eid congregation, came under a terrorist attack.
It happened within a week of the Dhaka terror attack that left at least 22 persons killed.
Two policemen and a housewife were killed in bomb blasts and a firefight in Sholakia. A suspected attacker was also killed.
RAB personnel had detained Shafiul with a bullet wound and a gun right after the attack.
He underwent treatment at Mymensingh Medical College Hospital under RAB custody.
Police said Shafiul was one of the three motorcycle-riding assailants who slit the throat of priest Jagneshwar Roy, 50, after hacking him with sharp weapons in the early hours of Feb 21.
Shafiul, a madrasa student from Dinajpur, said in initial interrogations after his arrest that he had taken part in the attack along with five others but he did not knew them.
He said he was only following the order of his 'chieftain'.
RAB said Shafiul was detained in a bloodied state, but he was visibly ‘unruffled’ by his wounds or the consequences he would face.
Abir Rahman, the suspected attacker killed in Sholakia, was a student of North South University.
He had been with dead Gulshan cafe attacker, another NSU student, Nibras Islam in Jhenaidah, police suspect.
Police also believe the two attacks were linked in the same thread.