Thousands of Afghans have been crossing into Turkey in recent weeks, as the Taliban swept through Afghanistan.
Turkey boosted security measures on its border with Iran to stop illegal crossings, mainly from Afghans fleeing the Taliban.
President Tayyip Erdogan said on Thursday Ankara had no intention of becoming "Europe's migrant storage unit".
On Saturday evening, authorities detained a small group of migrants sheltering in an abandoned barrack after crossing into Turkey from Iran.
"We have not come here for fun. Turkey is a better place. We thought here we will have facilities, we will earn to support our parents," one of the migrants said.
Foreign ministers of Turkey, Afghanistan and Iran discussed cooperation on security, energy, and migration in June but Turkish diplomatic sources say there is no specific mechanism between Ankara and Tehran to address migration from Afghanistan.
The U.N. refugee agency estimates 270,000 Afghans have been displaced inside the country since January, bringing the number of people forced from their homes to more than 3.5 million.