ISTANBUL — For Syrians looking to flee relentless violence, there aren't a lot of options left. Neighboring countries have clamped down on most escape routes, trapping hundreds of thousands inside the country.

Now Turkish officials say that, within five months, Turkey will build a gigantic wall to seal off the entire 900-kilometer border it shares with Syria, aiming to stop illegal crossings and combat smuggling. A 200-kilometer stretch has already been completed after construction began in 2014.

It's a reversal for a country that for years took in millions of Syrian refugees, with officials often pointing out the contrast between its generous open-door policy and Europe’s restrictive approach to refugees. As recently as last month, the Turkish parliament’s speaker Ismail Kahraman complained in a speech in Strasbourg that while Turkey took in 2.7 million Syrians, Europe was “building walls” and “closing their doors."

Now, however, Turkey is building its own walls, and despite Ankara’s insistence that the doors remain open for Syrians, more than 100,000 have become stuck at the border over the past year.

Of the 19 official crossings along the Turkish-Syrian border, only two remain open as legal options for Syrian refugees. Since March 2015, even these gates have been shut to the vast majority of Syrians. Humanitarian workers say that at most 200 people — often only critically wounded people — receive permission to cross each day. Turkey began stepping up its border protection measures in the wake of multiple terror attacks.

Turkey began stepping up its border protection measures in the wake of multiple terror attacks.

Everybody else tries to scrape together enough money to pay the smugglers. However, crossing illegally carries ever greater risks since Turkey began stepping up its border protection measures in the wake of multiple terror attacks.

“The Turkish army don’t allow anyone to get in and it is very dangerous for anyone who tries by smuggling,” said 23-year-old Mohamad Shaban in a Whatsapp message. His family tried unsuccessfully to cross the border to Turkey this summer but didn't have enough money for the smugglers and so were forced to return to Aleppo, where they now live under siege and heavy bombardment from the regime of Bashar al-Assad and its Russian allies. “When we were at the border," he said, the Turkish guards "fired into the air just so the people who try to cross feel afraid.”

This spring, Human Rights Watch documented the death of five Syrian refugees who were reportedly shot dead by Turkish border guards while getting smuggled across the border. A 15-year-old Syrian was killed on Wednesday after Turkish troops opened fire on refugees attempting to cross the border, Reuters reported. Talk of similar incidents abounds, but Turkish authorities deny the accusations.

“By March this year, we received the first reports of Turkish border guards shooting and killing families trying to cross,” said Gerry Simpson, HRW’s refugee researcher. “Since that time, it’s become nearly impossible to flee into Turkey.”

Turkey has plenty of legitimate reasons to fortify its porous border with Syria, long a gateway for smuggling goods, money and fighters into territory held by the Islamic State. Ankara also considers the Kurdish militias that control the eastern swathe of border territory a terrorist threat.

'Secure Syrian soils'

To combat both the Kurds’ advance and clear the jihadists from the border, Turkey launched an incursion into Syria in August. The areas liberated in alliance with Syrian rebels would serve as a “safe zone” where refugees could live inside their own country, Turkey’s president Recep Tayyip Erdoğan said last week.

“The problem of terrorism and the refugee problem will be resolved when we secure Syrian soils step by step," he told parliament. While Turkey has long advocated establishing such a “safe zone” along the border, its Western allies have balked at the idea, citing the need for patrol planes and a significant ground force to secure the area.

Refugee advocacy groups are alarmed at the suggestion and have called on Turkey to open its gates. Those trapped on the border mostly live in crowded camps on the edge of the conflict. The camps themselves are far from secure: in May, an air strike on one of the sites killed more than two dozen people.

Europe’s reaction to the restrictions has been muted. Turkey’s tightening of the border has had the side effect of reducing crossings to Greece. According to a UN Refugee Agency survey, almost 40 percent of refugees stayed for less than a month in a country of first transit before traveling on, suggesting that many journeyed more or less directly from Syria to Europe.

But Turkey isn’t alone in shutting its gates. Lebanon, which hosts more than a million refugees, has imposed visa requirements on Syrians; on the Syrian-Jordanian border, more than 75,000 are trapped in a no-man's land.

“We have an increasing trend in managed borders by Syria’s neighbouring countries, which are themselves creaking under the strain,” said UNHCR spokesman Matthew Saltmarsh, warning that many refugees could be “stranded in a dangerous situation” as a result.

The rejection of refugees at the land border contravenes international law, rights groups say. Countries are obliged to adhere to the principle of “non-refoulement,” which was defined as a ban on returning refugees to where they may face persecution under the 1951 Refugee Convention. But UNHCR has since noted that non-refoulement includes “non-rejection at the frontier.”

On holidays including Eid, Ankara has allowed Syrians living in Turkey to return and visit their loved ones. But the border closure has kept many families apart. Former law student Rida, 26, lives with his father in a village in the countryside surrounding Aleppo. Last year, his mother traveled to Turkey with his sisters and younger brother.

The men were planning to join them not long after but turned back when Turkish border guards opened fire, Rida said. Without him and his father, the family is struggling. His 17-year-old brother dropped out of school to work.

“I tried many times to cross illegally but wasn’t able to do that because the Turkish army shot at those who tried to cross,” he said. “I haven’t met or seen my family for a year.”