Turkish troops and Syrian rebels on Sunday pushed the Islamic State out of the remaining stretch of territory the group had controlled along the Turkish-Syrian border, severing the militants’ last access to the outside world.

Since 2013, when the group announced its formation, it has had territory bordering a NATO state — Turkey — but the sweep by Turkish forces and rebels fighting under the umbrella of the Free Syrian Army has brought that to an end.

According to the official Turkish news agency Anadolu, the Turkish army helped Syrian rebel allies secure 57 miles of border territory stretching from the Syrian towns of Azaz and Jarabulus by ejecting the militants from a string of villages on Sunday.

The Islamic State’s defeat in the border area had been inevitable since Turkey dispatched troops and tanks into Syria on Aug. 24 into Syria to support a long-stalled Syrian rebel offensive there, bringing new muscle to the fight.

But their removal from the border nonetheless marks a symbolically important moment in the war against the militants, who had long relied on their access to Turkey for supplies.

Above all, the border had served as the main conduit for the foreign fighters who have swarmed to participate in the militants’ ambitious experiment in Islamic governance, formalized in 2014 into what the group’s leadership termed a caliphate.

The traffic went both ways, and operatives who participated in attacks in Turkey as well as Paris and Belgium had crossed back across the border from Islamic State territory.

At one point the militants controlled towns along a stretch of the border spanning hundreds of miles. But they have been steadily pushed back by the efforts of the different groups working against them, including the Kurds farther east and the Syrian rebels in locations farther west.

The conquest came as President Obama pledged support for Turkey’s stepped-up role in the fight against the militants after meeting with Turkish President Recep Tayyip Erdogan at the Group of 20 summit in China.

The Turkish government has made it clear that its incursion into Syria is also intended to prevent Syrian Kurds from expanding the areas under their control. In comments to reporters after meeting Obama, Erdogan reiterated that the Kurds are as much of a target of Turkey’s Syria intervention as the Islamic State.

“Turkey’s fight against all terror organizations including Daesh and YPG will continue with determination,” he said, referring to the Islamic State and the main Syrian Kurdish militia, the People’s Protection Units.