A British man was freed from prison in Bangladesh on Thursday after his name was dropped from charges over a deadly 2016 attack by Islamist extremists on a Dhaka cafe popular with Westerners.
At least 22 people including 18 foreigners were killed when five militants with assault rifles and machetes stormed the Holey Artisan Bakery cafe in the capital's well-heeled Gulshan neighbourhood.
The Islamic State group said it had carried out the brazen assault on July 1, 2016 -- a claim rejected by Bangladesh.
Last month police pressed charges against eight homegrown extremists of local group Jamayetul Mujahideen Bangladesh (JMB). A court on Wednesday accepted the charges.
During the attack, military commandos stormed the cafe after a 10-hour standoff and freed more than two dozen hostages.
One of the freed hostages, Hasnat Karim -- a 49-year-old British national of Bangladeshi origin -- was later detained by police for more than two years over allegations he played a role in the attack.
"He has been freed from Kashimpur jail at around 4.30pm," Karim's wife Sharmin Parveen told AFP, referring to a high-security prison outside the capital.
She said Karim was on his way to his home in Dhaka.
Mohibul Islam Khan, counter-terrorism police deputy commissioner, last month said investigators found no evidence against Karim and his name had been left off the charge sheet.
Karim, his wife and their two children were celebrating the 13th birthday of their daughter in the cafe when the attack took place.
Karim was a lecturer at the North-South University in Dhaka, where two of the five attackers who were gunned down at the end of the siege had studied.
Nine Italians and seven Japanese were among the victims of the attack. Two policemen were also killed during the carnage.
The siege was by far the deadliest in a string of attacks claimed by Islamist groups which have blighted Bangladesh over the last five years.
Of the eight extremists charged, six have been arrested and two have absconded, police said. The eight face a maximum sentence of death by hanging under anti-terrorism laws.
All five militants were killed when police stormed the cafe. Eight others -- including mastermind Tamim Ahmed Chowdhury, a Canadian of Bangladesh descent -- were killed during raids in Dhaka and its suburbs months after the attack.
They included commanders of a new faction of the extremist group JMB.
The government has repeatedly denied that international jihadist networks have a presence in Bangladesh.
The IS-linked news agency Amaq however published extensive details of the attack, including photos from inside the cafe.
The hostage crisis marked an escalation from a spate of murders claimed by IS and Al Qaeda of rights activists, gay people, foreigners and religious minorities. It was seen as a major blow to the country's image as a moderate Muslim nation.
Dozens of atheist writers, publishers, members of religious minorities, social activists and foreign aid workers have been murdered in Bangladesh since 2013.