GAZIANTEP, Turkey (AP) -- Along the border near the southern Turkish city of Gaziantep, a wall of giant concrete blocks is going up as Turkey tries to seal off a region that for years was a jihadi highway through which thousands of extremist fighters flowed to join the Islamic State group in neighboring Syria.
Turkey has always denied permitting the movement of IS militants into Syria and insists it has been doing its best to stop the transit, even before construction on the massive wall began late last year.
Documents obtained by The Associated Press, however, tell a different story, showing a pattern of porousness along Turkey's 566-mile- (911-kilometer-) long border with Syria that has been vital for the extremist group's expansion as it built its self-declared "caliphate."
The AP analyzed 4,037 "entry documents" logged by the Islamic State group for its fighters entering from Turkey into Syria between September 2013 and December 2014. Around three-quarters of them entered through three particular crossing areas.
Those fighters alone would make up between 25 to 40 percent of the estimated total of IS's foreign recruits, and they likely do not represent all fighters that entered through Turkey during that period. According to CIA estimates, IS had 20,000-31,500 fighters by the end of 2014, around half of them foreigners. The documents were leaked to a Syrian opposition news site, Zaman al-Wasl, which provided them to the AP.
A deadly bombing of Istanbul's international airport on June 28 that killed 44 people raised fears that Turkey is paying a price for IS's free movement through its territory. Some analysts believe IS struck in revenge for Turkey's support for the U.S-led coalition against IS, its tighter border controls and its backing for rebels working to recapture the last stretch of the border that the extremist group still holds on the Syrian side.
The ease with which militants crossed into Syria from Turkey has long brought accusations that Ankara's determination to oust Syrian President Bashar Assad by backing Syrian rebels trumped any concerns over fueling the jihadi movement. The relatively open border was crucial for rebels, including ones backed by the United States, and the fighters used Turkish territory as a crucial rear base and supply route. It was also a life-saving escape route for some 2.75 million refugees who fled into Turkey and an avenue for humanitarian aid to opposition-held areas of Syria.
"Until the rise of ISIS in 2014, Turkey was basically turning a blind eye to radical foreign fighters who were crossing into Syria," said Turkish analyst Soner Cagaptay, an expert at the Washington Institute for Near East Policy, referring to the group by its former acronym. "Not because Turkey was in favor of radicals or supported radicals ... but because they thought they were war-hardened fighters who could accelerate the demise of the Assad regime, helping Turkey toward its final objective."
A Turkish official, who spoke on condition of anonymity in line with government protocol, rejected the claim Ankara ever knowingly allowed jihadi fighters to cross into Syria. He pointed out that Turkey arrested thousands of foreign fighters and sent them back to their home countries.
He argued that source countries that allowed such dangerous elements to head to Turkey should be the ones under scrutiny. He said Ankara's requests to other governments, including in the European Union, for intelligence sharing about these suspects were not taken seriously until late 2014.
Turkey deported about 3,250 foreign fighters from 2011 to March 2016, according to the Foreign Ministry. This year, Turkey has detained 1,654 IS suspects, Interior Minister Efkan Ala said recently. Of those, 663 remain in custody, more than half of them foreigners.
IS has not claimed responsibility in the triple suicide attack at Istanbul's Ataturk Airport, but Turkish officials suspect it is behind it. The group has boasted in the past about having cells in Turkey. Security forces have been busy rounding up IS suspects in the wake of the bombing.
"Turkey has the power, determination and capacity to continue the fight against terrorism until the end," President Recep Tayyip Erdogan said after the attack.
Partly under U.S. and EU pressure, Turkey tightened its border controls, starting late last year. Government authorities began overseeing construction of the wall, which will cover more than a third of the border when complete and include watchtowers and infrared thermal cameras. Turkish guards began to push back Syrians too, trapping tens of thousands fleeing the conflict.
The documents obtained by the AP were compiled by the IS "border authority" for fighters entering from Turkey. Of the 4,037 entry documents, around 3,900 list the entry points. They show 19 different areas used as crossings. But the majority of fighters, some 2,930, entered through three Syrian areas of Tal Abyad, Jarablus or Azaz. Those crossings correspond with Akcakale, Karkamis and Oncupinar on the Turkish side.
The documents, which also list the nationalities of the entering fighters, show they come from all over the world, including Europe, North Africa, the Middle East, the Caucasus region and South Asia. German intelligence authorities have said that similar IS registration documents they have seen appear to be genuine.
The documents don't specify if the fighters used the official crossings or smuggling routes nearby — but witnesses told the AP they used both.
A Syrian smuggler who works in the Syrian border area of al-Rai says that until November, the area, including the Jarablus crossing, was heavily trafficked by IS fighters. He says the group would bring in 30 to 40 people daily at the border at his village.
The IS entry documents list 190 fighters who crossed through al-Rai in 2014.
"Until eight months ago we could see how IS would approach the border with their cars and then cross over by foot or motorcycle," he said, speaking on condition of anonymity to discuss his illicit business.
"Sometimes the (Turkish) soldiers would tell the villagers and smugglers to just make sure people don't have weapons if they were going from Syria into Turkey, but from Turkey to Syria you could bring as much as you can."
Further east, the divided town of Tal Abyad, known on the Turkish side as Akcakale, was another important entry point for IS, opening to a road leading directly south to the "caliphate's" de facto capital, Raqqa.
"IS would go in and out of Turkey with greater ease than the civilians," recalls a former Syrian rebel who helped man the border gate on the Syrian side when IS was in control of Tal Abyad. He said Turkish authorities photographed everyone going through the crossing. "The foreign fighters were obvious from their look and from the language," he said.
When the crossing was closed on weekends, foreign fighters used known smuggling routes. "The Turks knew. They went right past them," he said.
That route, however, was shut down when Kurdish led-forces took Tal Abyad in June 2015.
One the most notorious IS fighters to cross from Turkey into Syria is Mohammed Emwazi, the British militant shown beheading Western hostages in IS videos. In summer 2013, he and a friend used the Bab al-Hawa crossing into northwestern Syria, according to a posthumous account he supposedly wrote, published in April in IS's French-language publication, Dar al-Islam.
The account of his journey details the difficulties the pair encountered at each international crossing, from hiding in the back of a truck from England to France to the $2,000 he claimed was stolen by a Turkish guard on the crossing from Greece. But at Bab al-Hawa, "we entered Sham (Syria) with no problems," reads the account.
Cagaptay says Ankara's relationship with the IS group gradually soured, starting in June 2014 when the extremists took 49 Turkish diplomats and their families hostage after overrunning the Iraqi city of Mosul. It wasn't until September of that year that Ankara was able to secure their release.
Since the spring, Turkey has been backing Syrian rebels pressing to take back the last 45-mile stretch of the border still controlled by the Islamic State group, including Jarablus and the al-Rai area. At the same time, U.S.-backed fighters from the mainly Kurdish Syrian Democratic Forces have been waging their own offensive from the east trying to take the border area.
"The corridor is crucial to ISIS' survival," Cagaptay said. "It's the main conduit of what was once a large smuggling area for ISIS to get fighters in and out, weapons in, funding in, oil and antiquities out. If ISIS loses that corridor it will basically be stifled."
"I think this is the tactical reason, in my view, why ISIS decided to respond in Istanbul."
Still, some Turks blame Ankara's policies for the airport attack. About 200 protesters shouted against the ruling Justice and Development Party last week, accusing it of supporting the IS group.
"The government supports IS, and innocent people are killed," said protester Berivan Tanriverdi.