The family of a University of Toronto student detained more than eight days ago after a deadly terror attack in Bangladesh is pleading for him to be released.

Tahmid Hasib Khan, 22, had just arrived in the capital Dhaka on July 1, when terrorists took dozens of hostages in the upscale Holey Artisan Bakery.

By the time security forces gained control, at least 22 people were killed – the vast majority of them foreign nationals. ISIS has claimed responsibility.

Some of the freed hostages told the New York Times that Khan and other Muslims were spared because of their religion. They said Khan was forced by the attackers at one point to hold a gun.

His brother Talha Khan, who lives in Toronto, told Â鶹´«Ã½ that Tahmid was “officially taken in as a witness.â€

Talha says his brother is “liberal-minded†and “exactly the antithesis of the kind of person who would take part in such horrendous acts.â€

Khan had just finished summer school exams when he went to Bangladesh to be with his parents during the Muslim holiday of Eid, according to Talha. After that, he was heading to a summer internship with UNICEF in Nepal.

Talha said their mother was heartened last week when authorities allowed her to send food to Khan on Eid. But authorities have not allowed the family any contact for days, he said.

Gar Pardy, Canada’s former director general of consular affairs, who has worked in Bangladesh, said that police tend to round up innocent people after attacks “and Mr. Khan is a victim of that.â€

Bangladeshi authorities to halt “arbitrary arrests†after thousands were detained -- sometimes for weeks without charges -- in connection with the murders of atheists, non-Muslims and LBGT people.

Although Talha is a citizen of Canada, his brother is only a permanent resident.

Global Affairs has said that it is monitoring the situation.

Talha hopes the Canadian government will do as much as possible to “to ensure (Khan) can return from Bangladesh, continue his studies and eventually become a professional in global health and make the world a better place.â€

Khan has received plenty of support from the University of Toronto, where the global health major was a fixture in the Model United Nations club.

University of Toronto President Meric Gertler has written to Foreign Affairs Minister Stephane Dion to “express concern for the safety and fair treatment of our student.â€

He said Khan is a student “in good standing, is actively progressing towards a degree, and is involved in University-related extra-curricular activities, as well as sports and music.â€

“I recognize that Global Affairs Canada will be working through appropriate diplomatic channels to ascertain the facts and to advocate with colleagues in Bangladesh for Mr. Khan’s rights,†Gertler added.

The Bangladeshi Students’ Association at the university has also written a letter of support for Khan.

The group posted on Facebook that Khan is a supportive friend, extremely hardworking and a lovable character. The group says it is “praying for his release.â€

With a report from CTV’s Omar Sachedina