The United States and Turkey have signed an agreement to train and arm Syrian rebels fighting the Islamic State group, two senior defense officials confirmed to Fox News. 

The two countries have been in talks about such a pact for several months. The deal was signed Thursday evening by U.S Ambassador John Bass and a senior Turkish foreign ministry official,  said Joe Wierichs, the spokesman for the U.S. Embassy in Ankara. He gave no further details.

The Turkish government has said the training could begin as early as next month at a base in the central Anatolian city of Kirsehir, and involve hundreds of Syrian fighters in the first year. The U.S. has said the goal is to go after the Islamic State group, but Turkish officials have suggested that the trained rebels could also target the Syrian government of President Bashar Assad.

With its 750 mile border on Syria, Turkey is a key part of the U.S.-led coalition against the Islamic State group. But negotiations with the U.S. over what to do about the Islamic militants have been fraught with disagreement -- with Turkey insisting that the coalition needs to also target the Assad government.

Fox News' Lucas Tomlinson and The Associated Press contributed to this report.