France and the United Kingdom have said they will retain their troops in Syria despite the decision of United States President Donald Trump to withdraw his military from the country. Both countries are partners in the US-led coalition fighting militants in Syria.

Announcing his decision on Wednesday, Trump had claimed that the Islamic State militant group had been defeated in Syria. US officials had said they were considering a total withdrawal of forces from the country, although it was not clear when the troops, numbering over 2,000, would eventually be pulled out.

Florence Parly, the defence minister of France, on Thursday acknowledged that the Islamic State had been weakened in Syria, but said it had not been fully eliminated. “Islamic State has not been wiped from the map nor have its roots,” she said in a tweet. “The last pockets of this terrorist organisation must be defeated militarily once and for all.”

France will keep its troops as the Islamic State group continues to pose a threat to its interests, Reuters reported, quoting unidentified officials. France has over 1,000 troops stationed in the north of the country.

Trump’s decision took France by surprise, according to senior diplomats. “It shows that we can have different priorities and that we must count on ourselves first,” said Minister for European Affairs Nathalie Loiseau. “For now, of course we are staying in Syria because the fight against Islamic State is essential.”

Senior diplomats said that French President Emmanuel Macron spoke with Trump on Wednesday. When Trump had announced a US withdrawal in April, Macron had cited an Iranian threat in the region and persuaded him to stay on.

Meanwhile, a UK government spokesperson said in a statement: “Since military operations began, the coalition and its partners in Syria and Iraq have recaptured the vast majority of Daesh [Islamic State] territory and important advances have been made in recent days in the last area of eastern Syria, which Daesh has occupied. But much remains to be done and we must not lose sight of the threat they pose. Even without territory, Daesh will remain a threat.”

“This government will continue to do what is necessary to protect the British people and our allies and partners,” the spokesperson added.

Israeli Prime Minister Benjamin Netanyahu, after speaking to Trump over telephone, described the withdrawal as “an American decision”, Al Jazeera reported. “We will safeguard the security of Israel and protect ourselves from this arena,” Netanyahu said.

Russian President Vladimir Putin, an ally of Syria, said Trump was right in his decision, AFP reported.