Karim and Khan were among 32 survivors rescued by police and taken into custody for questioning.
A court in Bangladesh on Thursday allowed police to detain two men over an attack claimed by militant group Islamic State on a cafe in the capital, Dhaka, that killed 20 hostages, mostly foreigners.
The case has drawn criticism from human rights groups who say the suspects were illegally detained and denied access to a lawyer. A lawyer for one of the two men, Hasnat Karim, said his client was innocent and demanded his immediate release.
Karim, who holds dual British and Bangladeshi citizenship, and Tahmid Hasib Khan, a student of Toronto University, were dining separately with family and friends when gunmen stormed the Holey Artisan Bakery on the evening of July 1.
The suspected Islamist militants singled out non-Muslims and foreigners, killing Italians, Japanese, an American and an Indian before security forces stormed the eatery to end the 12-hour siege. Two police also died in the operation.
On Thursday, a Dhaka court remanded the men in custody for eight days for interrogation, with police official Masudur Rahman telling reporters they had been arrested on Wednesday night "from two different places".
The police assertion of arrests at different sites appeared to run counter to relatives' statements that the men were held at unknown locations after the attack.
"The authorities have finally admitted that Mr Karim is in their custody," his London-based lawyer, Rodney Dixon, told Reuters in a statement.
"They have had more than sufficient time to make any inquiries. There is clearly no evidence to charge him and he should be let go without any further delay."
Rights group Amnesty International has criticised the detention of the men as having denied them their fundamental right to legal representation.
The formal arrests take to seven the tally for the cafe attack, which the government blames on local militants, along with another, on July 26, in which police killed nine militants believed to be plotting a similar assault.
The government has dismissed suggestions that Islamic State has a presence in Bangladesh, even though 'selfies' of some of the attackers posing with an automatic rifle were posted on the jihadi group's propaganda outlets during the siege.
In the past year, al Qaeda and Islamic State have made competing claims over the killings of liberals and religious minorities in the mostly Muslim nation of 160 million.
Karim and Khan were among 32 survivors rescued by police and taken into custody for questioning. Police released the others soon after, but the two men's families said they had not returned.
Karim, a 47-year-old engineer, was at the cafe with his family to celebrate his daughter's 13th birthday.
Relatives of Khan, 22, told the New York Times that the student, who has epilepsy, had been beaten and denied medical attention after being held.
Khan's father, reached by telephone, declined to comment.