The YPG/PKK terror group has released Daesh terrorists in northern Syria to attack Turkey, the nation’s top diplomat said on Wednesday.

"PYD/YPG has not hesitated to make a direct agreement with Daesh. As a result of the deal in Raqqa, hundreds of Daesh militants have been freely evacuated with buses," Mevlut Cavusoglu told lawmakers in the Turkish parliament.

Listed as a terrorist organization by Turkey, the U.S., and the European Union, the PKK has been responsible for deaths of 40,000 people, including women, children and infants in its more than 30-year terror campaign against Turkey. The PYD/YPG is the Syrian offshoot of the terror group.

"They have not only released the Daesh terrorist in northern Syria in exchange for attacking Turkey, but they have also given them money," said Cavusoglu.

Earlier, President Recep Tayyip Erdogan said he discussed the fate of Daesh prisoners held by the YPG/PKK over the phone with U.S. President Donald Trump and said Turkey could take responsibility for them, but the YPG/PKK immediately released Daesh prisoners.

The Turkish leader also said that Turkey could assume responsibility for Daesh terrorists imprisoned across northern Syria and might send foreign fighters back to their home countries.

Turkey on Oct. 9 launched Operation Peace Spring to secure its borders by eliminating terrorist groups there, to ensure the safe return of Syrian refugees and Syria’s territorial integrity.

Ankara wants to clear northern Syria east of the Euphrates of the terrorist YPG/PKK.

Lambasting countries criticizing Turkey's Operation Peace Spring, Cavusoglu said they aim to establish a terrorist state in northern Syria.

"Look at the countries, especially France, which are reacting [against Turkey’s Syria operation], their aim is to establish a terror state there," Cavusoglu said in the capital Ankara.

On Saturday, Germany and France announced they halted arms export to Turkey, citing Operation Peace Spring.

Cavusoglu said that any threat or sanction -- "whenever they come" -- will never be accepted by Turkey.

"They will not affect Turkey's determination," he stressed.