A Bangladeshi teenager who police say was a suspect in last week's deadly attack on a Dhaka cafe has died in custody, with his family insisting he was a hostage and alleging torture by security forces.

Zakir Hossain Shawon, 18, a kitchen assistant at the Holey Artisan Bakery, was arrested after last week's deadly siege by suspected Islamists in which 22 people, including 18 foreigners, died.

Police killed five attackers and arrested Shawon together with another man over "suspicious activities", treating him as a suspect – a claim vehemently rejected by his family, who claim he was taken hostage like other victims.

He died in the intensive care unit of Dhaka Medical College Hospital late Friday after five days in the clinic, police and his family said.

READ: Bangladeshi rich kids who grew up to be extremists

Shawon's father Abdus Sattar demanded an investigation into his death, saying his "innocent son and the main breadwinner of his family" died due to torture.

"His whole body had marks of torture. There were marks of curdled blood in many places. One of his eyes and two knees were blackened. His wrists were blackened. It seems he was hanged by ropes tied to his wrists," Sattar told AFP.

Nur Khan Liton, the head of Ain o Salish Kendra, a leading human rights group, said there were doubts about Shawon's involvement in the attack, which was claimed by the Islamic State group.

"IS has named five attackers and police have identified all five. And he was not among the five," he said.

"If he was treated as an associate or helper of the attacker, police must present evidence or information."

READ: Bangladeshis who died in Dhaka attack were Monash Malaysia students

Police and military representatives denied that Shawon had been tortured in custody.

"He was held because of suspicious activities. We did not have any opportunity to interrogate him since he was injured and hospitalised," Dhaka police spokesman Masudur Rahman told AFP.

The teenager's father said he spoke with his son hours before the July 1 carnage when Shawon called to say he had received a bonus payment for Eid al-Fitr, the largest Muslim festival.

He had planned to travel home to celebrate the occasion with the family in Dhaka's suburb.

Instead his family saw him in hospital following the attack in Dhaka's upscale Gulshan neighbourhood.

"He could not recognise me or his mother and thought we were his brother," the father said.

"He would cry out in his sleep, pleading with someone, "Please don't hit me. Let me go," he added.


Eid attack

Meanwhile the country's police chief said Saturday that extremists from Jamayetul Mujahideen Bangladesh (JMB), a local Islamist group blamed by the government for the cafe siege, were behind a separate attack on an Eid gathering.

Bangladesh's home minister last week said the banned JMB carried out the Gulshan cafe attack despite the Islamic State group claiming responsibility.

Attackers carrying bombs and machetes killed at least three people at a huge prayer rally marking the start of the Muslim festival in the northern town of Sholakia on Thursday.

"(The perpetrators) are members of JMB. They did it (the attack) in Gulshan and they also did it here," Inspector General of Police Shahidul Hoque told reporters in Sholakia.

Police have arrested one person over the Eid attack.