It's the latest outbreak of violence between migrants and locals in Turkey in the wake of simmering tensions. Human rights groups say Turkey has fast become an unsafe country for millions of migrants and refugees seeking to resettle in Europe.
Since 2014, Turkey has granted temporary special protection to nearly 3 million Syrians fleeing war, but this status is not available to Afghans, who can only apply for refugee status or political asylum in a third country and remain in Turkey while they await a decision.
The recent detentions in Istanbul have been just one part of a tense week in Sultanciftligi, a lower-class neighborhood that is home to ethnic Kurds and Turks.
News of stabbings and disappearances have brought thousands of undocumented migrants living there under scrutiny, pushing most into hiding. On a normal afternoon, the neighborhood is teeming with young Afghan and Pakistani men, who spend up to 12 hours a day working in basement garment factories, and living in ramshackle, overcrowded apartments rented out by their employers.
Police then responded by raiding homes and rounding up hundreds of migrants.
Adeel Ahmed, 19, said he hid in his room in a nearby neighborhood with 17 other Pakistanis, where they shared videos and pictures of beatings and stabbings from the night before.
"We are very, very scared. We don't know who is doing this. Nobody is safe anymore," Adeel said, looking at one of the many videos, one of which showed a migrant being stabbed in the chest with knife.
Rumors of violence by locals have spread among migrants. One such rumor was that six Pakistanis had been killed in Sultanciftligi. Turkish, Afghan and Pakistani officials denied those allegations.
In Istanbul's Vefa district, Abdul Razak, 21, said he's preparing to return to his home in Lagman, Afghanistan, six months after he scraped up $1,300 to be smuggled into Turkey. Razak, like many migrants who find themselves in dire straits in Istanbul, pulls a cart weighing hundreds of pounds through the city's streets to collect plastic, glass and cardboard, to sell to Turkish recyclers. But on Friday, as he was making the rounds, he was attacked by five Turkish men, who he says seemed to be angry because of what had happened in Sultanciftligi.
"I came here because I wanted to find a way to go to Europe, but now, I cannot go further, and I don't feel safe here either," Razak said.