The order to withdraw American troops from Syria has been signed, the US military said Sunday, after President Donald Trump and his Turkish counterpart agreed to prevent a power vacuum in the wake of the controversial move.

The announcement that US troops would leave the civil war-racked country -- where they have been deployed to assist in the multinational fight against the Islamic State (IS) jihadist group -- shocked global partners and American politicians alike.

‘The execute order for Syria has been signed,’ a US military spokesperson told AFP when asked about the withdrawal order, without providing further details.

Turkey was a rare ally that lauded Trump's momentous decision on Syria, a country where it will now have a freer rein to target US-allied Kurdish fighters who have played a major role in the war against IS but are deemed terrorists by Ankara.

Trump and President Recep Tayyip Erdogan spoke by telephone on Sunday and ‘agreed to ensure coordination between their countries' military, diplomatic and other officials to avoid a power vacuum which could result following any abuse of the withdrawal and transition phase in Syria,’ the Turkish presidency said in a statement.

Late Sunday, Trump tweeted that Erdogan had assured him that any remaining IS fighters in Syria will be eliminated.

‘President @RT_Erdogan of Turkey has very strongly informed me that he will eradicate whatever is left of ISIS in Syria,’ Trump said in a Tweet around midnight Sunday, using another acronym for the militant group.

Repeating a pattern of admiring comments towards global strongmen, Trump added that Erdogan ‘is a man who can do it.’

The US president concluded: ‘Our troops are coming home!’

Hours earlier, Trump had tweeted that he and Erdogan ‘discussed (IS), our mutual involvement in Syria, & the slow & highly coordinated pullout of US troops from the area.’

US politicians -- including those from his own Republican party -- and international allies fear the withdrawal of the roughly 2,000 US troops is premature and would further destabilize the already devastated region.

A US withdrawal, said Mutlu Civiroglu, a Kurdish affairs analyst, will open the way ‘for Turkey to start its operations against the Kurds, and a bloody war will begin.’

French President Emmanuel Macron on Sunday said he ‘deeply regretted’ Trump's decision, and that ‘an ally must be reliable.’

- New Pentagon chief -

US troops will leave under the auspices of a new Pentagon chief set to start next month, after Jim Mattis resigned from the post citing key differences, including on Syria, with the often-impulsive Trump.

Several US politicians from both parties rejected Trump's claim that IS had been defeated, and the decision also caused alarm and dismay in the US military over the prospect of suddenly abandoning Washington's Kurdish partners.

Trump's sudden decision sparked turmoil within his administration, prompting the resignation of Brett McGurk, the special envoy to the anti-IS coalition, as well as Mattis.

Plans for the troop withdrawal will now be overseen by Deputy Secretary of Defense Patrick Shanahan, who Trump on Sunday said would replace Mattis starting January 1.

Mattis, 68, had said he would leave at the end of February to allow a smooth transition for the next chief of the world's top military power -- but a reportedly angry Trump accelerated his departure by two months.

Defense spokeswoman Dana White tweeted that Mattis would still assist in the handover, working with Shanahan to ensure the department ‘remains focused on the defense of our nation during this transition.’

According to US media, Trump voiced resentment over news coverage of Mattis' stinging resignation letter that laid bare his fundamental disagreements with the president.

Days later, special envoy McGurk made a similar move, saying he could not support Trump's Syria decision that, he said, ‘left our coalition partners confused and our fighting partners bewildered.’

Unlike Mattis, Shanahan has never served in the military and has spent most of his career in the private sector.

He spent over three decades working for aircraft giant Boeing, including as vice president and general manager of Boeing Missile Defense Systems, before moving to the Pentagon as deputy in 2017.

Until Trump finds a permanent Pentagon chief, Shanahan will lead plans for US troops to leave Syria along with a significant drawdown in Afghanistan, both of which critics worry will leave war-torn regions at risk of continued and potentially heightened bloodshed.