Syrian refugees from Tal Abyad wait on the Turkish-Syrian border after crossing into Turkey near the Akcakale border gate in Sanliurfa province, Turkey, June 14, 2015. Reuters/Kadir Celikcan

When the bombs started falling around their homes over the weekend, the people of Tal Abyad had two choices: Stay inside the Syrian town, controlled by the Islamic State group and under siege by Kurdish militias, or flee to the Turkish border, without knowing if or how they could cross to safety and to a life as refugees. For tens of thousands of people, the decision was an easy one. They walked to the barbed-wire fence on the border of Turkey to escape the fighting, but found Islamic State fighters guarding the crossing, telling them to turn around and go home. The militants told them they would be safer in their homes, and in any case, they couldn't flee: Those who tried would be shot.

Some obeyed. The Sunni militant group, also known as ISIS, had provided food rations and some social services to the people of Tal Abyad. Others, in fear of staying under prolonged ISIS rule, waited for their chance to get into Turkey.

"ISIS wanted everyone to support them. If the people of Tal Abyad tried to leave, ISIS threatened to kill them," Yasser, a Syrian activist at the border crossing, told International Business Times, describing a chaotic and desperate scene on the border. He did not want his last name mentioned, fearing, like many Syrian activists, for his life.

Others took the risk, and crossed illegally. Carrying bags of food and clothing, Syrian mothers and fathers passed newborn babies through the fence near the entrance to the town of Akcakale, which had been closed by the Turkish authorities.

"They had no other choice but to cut through the fence illegally and enter Turkey," Yasser said.

The situation in Tal Abyad, in northeastern Syria, resembles the predicament of many Syrians caught between war and an increasingly less hospitable Turkey, which already hosts more than 1.7 million Syrians who fled the conflict, according to government statistics.

They have to choose between living under ISIS, which has a history of brutality but also provides some food and social services, or attempting a risky flight to Turkey, during which ISIS could kill them.

The Turkish government, not the United Nations or other relief organizations, is in charge of the millions of Syrian refugees in the country. The government oversees the camps and all of the relief and medical services, and as a result the U.N. has no control over the flow or placement of refugees into camps.

According to estimates from the Turkish government, more than 21,000 people fled to Turkey’s Sanliurfa province over the past week. The U.N. said in a press statement Tuesday that Turkish authorities set up facilities to register Syrians who crossed the border and vaccinated all of the children who passed through.

The refugees are in the hands of a government that may help them but, many among them suspect, is also secretly helping ISIS, Yasser said.

Several reports over the past three months point to Turkey's possible connection to the Sunni militant group. Last month the New York Times published an article about Turkish border guards allowing the transit into Syria of fertilizer that can be used to build explosives, such as those used in the large vehicle bombs ISIS often uses in suicide attacks. Reuters published a story claiming Turkish intelligence helped ship arms to Islamist rebels in Syria.

It is still unclear how many people are left in Tal Abyad. Kurdish forces have overtaken the city and chased out ISIS, but have not called for the Syrians to return to their homes.

The Kurdish forces, though they have liberated the city from ISIS, are not trusted by many

The residents of Tal Abyad distrust the Kurdish fighters from the YPG militia. The Turkish government, which is in its turn hostile to Kurds, accused the Kurdish militia of "ethnic cleansing" against Arab and Turkmen residents, with the help of U.S. airstrikes.

According to Agence France-Presse, President Recep Tayyip Erdogan said the coalition airstrikes “could lead to the creation of a structure that threatens our borders." "Everyone needs to take into account our sensitivities on this issue," he said.

The American Embassy in the Turkish capital Ankara on Monday disputed Turkey's accusations that the airstrikes also hit civilians, saying on Twitter “contrary to insinuations from some in the media, the coalition works hard to ensure civilians are not hit in airstrikes.”

In a second Twitter post, the embassy said that “civilian outflows from Tal al-Abyad are the result of people fleeing fighting brought about by #ISIL,” an alternative name for ISIS.

Meanwhile, Yasser said, thousands of people from Tal Abyad are still stationed at the border crossing in Turkey, waiting to be transferred to a refugee camp. The United Nations, he said, does not have a presence at the border.