DHAKA (Reuters) - Bangladesh police have charged eight militants over a 2016 attack on a cafe in Dhaka that killed 22 people, and freed a British suspect detained without charge for the past two years.

Briton Hasnat Karim was detained after the July 2016 attack in Dhaka on suspicion of being involved. Rights group Amnesty International had campaigned for his release.

Karim was with his family celebrating his daughter’s 13th birthday at the café, when militants barged in, taking 22 hostages, mostly foreigners, who were killed over 12 hours.

Karim became a suspect after he agreed to a demand to act as a human shield during the ordeal, witnesses said at the time.

An investigation found Karim was not involved, Monirul Islam, the head of the police’s counter terrorism and transnational crime unit, said on Monday.

“During our two-year long investigation, we did not find any involvement (of Karim) in this attack directly or indirectly, so he was acquitted from this case,” Islam said.

Islamic State had claimed responsibility for the cafe attack, though Bangladesh has denied the group’s involvement and Islam said the investigation showed no involvement of foreign militants.

“All of them belong to (Jama’atul Mujahideen Bangladesh), a home grown militant group,” he said, saying eight militants had been charged.

Nine Italians, seven Japanese, an Indian and a Bangladeshi- American and four Bangladeshis, including police, were killed.