Turkey has agreed to allow the training of at least 2,000 Syrian opposition fighters on Turkish soil by American and Turkish special forces, Turkish officials said on Saturday, as Islamic State militants came closer to capturing the Syrian city of Kobani.

Turkey has long balked at allowing such training on its territory, and officials in both countries said the shift could lend an important boost to the Pentagon-led mission. The training aims to strengthen moderate forces arrayed against Syrian President Bashar al-Assad and a growing regional threat from Islamic State extremists.

U.S. officials said on Friday that Turkey had agreed to support a new Pentagon-led arming and training program for moderate Syrian rebels, but provided few details. Earlier in the week, Turkish President Recep Tayyip Erdogan indicated his support for training and equipping rebels to back U.S.-led airstrikes with ground operations.

“We have an agreement on this, with operational details to be worked out through ongoing consultations and planning,” a senior Obama administration official said.

On Saturday, a Turkish official said the country’s MIT intelligence service will use its own databases to select and screen an initial 2,000 fighters to undergo training in Turkey.