Syria-Turkey Border, Sept. 19, 2014
Turkish soldiers stand guard as Syrian Kurds cross the border fence into Turkey near the southeastern town of Suruc in Sanliurfa province. Reuters/Stringer

ISTANBUL -- The Turkish parliament passed a motion Thursday authorizing the military to enter Iraq and Syria to fight the Islamic State group, and allows for foreign troops to use Turkish bases. The vote marked the first time the Turkish government has shown it is committed to fighting the Sunni militant group also known as ISIS, which has taken control of large swaths of Iraq and Syria. The Islamic State group has now fought its way to Kobane, Syria, just a few miles from Turkey, the closest it has ever been to the territory of a nation that is both a NATO ally and on the doorstep of Europe.

In many ways, the future of the fight against ISIS rests in Turkish President Recep Tayyip Erdoğan’s hands, Luay al-Khatteeb, director of the Iraqi Energy Network, a consultancy that advises the Iraqi parliament, said. The U.S.-led coalition is not only dependent on Turkey for stopping the flow of fighters and weapons into Syria but also relies on its security forces on the border to shut down the ISIS oil trade.

Until now, Turkey has shied away from intervening in the Syrian conflict, claiming it was too consumed with hosting the hundreds of thousands of refugees from that war who are seeking shelter on Turkish territory. But now hardline extremists have gained momentum, and the Free Syrian Army, the coalition of moderate rebels in the Syrian civil war that is receiving U.S. aid, has fallen behind. Fighting on two fronts, against President Bashar Assad’s forces and extremist groups, they have lost control of key border crossings with Turkey.

At the end of March 2012, fighters with the Syrian opposition witnessed the first sign that the extremist forces they had warned the U.S. about were organizing near the Turkish border. A black flag, now the emblem of the Islamic State group, flew on a pole next to the Bab al-Hawa checkpoint, one of the main entryways into Syria from Turkey. Now those extremists, who have morphed into the Islamic State group, are just a short drive from confronting Turkish forces on the border.

Extremists from the al Qaeda-affiliated Al Nusra Front and ISIS are using their control of checkpoints on the border with Turkey to finance their fight in Syria through a lucrative smuggling network. Their leaders also regroup and meet inside Turkey, using its territory as their de facto command center, safe from Syrian government attacks and from the Free Syrian Army moderate rebels, said Rami Jarrah, a Syrian activist and journalist.

In recent weeks, Turkey has been accused of allowing ISIS fighters to cross through the border and sell oil from the fields they captured in Iraq and Syria on its black market.

Airstrikes on refineries have severely curtailed ISIS oil revenue, but ISIS has occupied and holds towns around Kirkuk, in Iraqi Kurdistan, a major oil hub. From there it has the potential to tap into the production process and get into the distribution of crude. Turkish border guards have seized recently 1,400 meters of pipeline, or almost a mile, at crossings, in an indication that ISIS may be trying to build its own oil distribution.

Speaking at the World Economic Forum in Istanbul earlier this week, oil analysts said that the more immediate concern for Western nations is the risk that ISIS may interrupt the flow of oil from Iraqi Kurdistan into Turkey, which then goes on to the European market.

In 2013, the Kurdistan Regional Government in Iraq completed the construction of a pipeline on the Turkey-Iraq border that connects to the Kirkuk-Ceyhan pipeline. The pipeline has a capacity of about 150,000 barrels a day, and it lies in territory that may soon be captured by ISIS.

Ibrahim Kalin, Turkish assistant undersecretary of state and senior adviser to the prime minister, said Turkish security forces “register every person that comes through, even if they do not have papers.”

At the eight border crossings they control, they have stopped close to 6,000 foreign fighters who were trying to enter Syria. According to the Turkish Armed Forces, between Sept. 19 and Sept. 25, security forces on the Syrian border detained 1,061 people and seized goods including guns and hand grenades.

Oytun Orhan, a researcher at the Center for Middle Eastern Strategic Studies in Istanbul, said Turkey is not aiding ISIS and that the allegations are “misguided.”

“In an environment where people flock to fight for ISIS from all around the world through different channels, it is unrealistic to forge a direct link between Turkey and ISIS,” he wrote in a recently published paper.

Although Turkish officials said they have established a formula for tracking down smugglers and stopping extremist foreign fighters from entering Syria, they have not completely quelled the ISIS threat. Just two days ago ISIS fighters were captured on camera entering Syria from Turkey to fight in Kobane.

But if the opposite happened -- if ISIS fighters entered Turkey in arms, or attacked Turkish forces inside their territory -- then Turkey could rely on the support of NATO. The secretary-general of the alliance, Jens Stoltenberg, said this week that NATO would defend Turkey against any attack. “Our responsibility, the basic responsibility, is to stand up and be very clear that we are going to protect Turkey,” he said.