US President Donald Trump has defended his surprise decision to declare victory over so-called Islamic State militants in Syria and withdraw US troops from the country, amid criticism from some Republicans and concern from allies and some US military commanders.

In early morning tweets today, Mr Trump said he was fulfilling a promise from his 2016 presidential campaign to leave Syria. Echoing a central plank of his foreign policy - that he seeks to stop the United States being taken advantage of - he said the United States was doing the work of other countries, including Russia and Iran, with little in return.

"Does the USA want to be the Policeman of the Middle East, getting NOTHING but spending precious lives and trillions of dollars protecting others who, in almost all cases, do not appreciate what we are doing? Do we want to be there forever? Time for others to finally fight," he tweeted.

The United States is also ending its air campaign against the militants in Syria, US officials said today.

Mr Trump had pledged to withdraw from Syria if elected, but the abrupt announcement yesterday to withdraw the roughly 2,000 US troops from Syria caught US lawmakers and others by surprise. The White House declined to offer a timeline for the departure.

Some of Mr Trump's fellow Republicans strongly criticised the move, saying they were not briefed ahead of time and that the move strengthened the hand of Russia and Iran, which both support Syrian President Bashar al Assad.

US officials, said that US commanders on the ground are also concerned about the impact of a quick withdrawal and were surprised by the decision.

Mr Trump's move also drew criticism from some US allies, including Britain and France, who said IS militants had not been defeated and that its troops would remain in Syria.

The void left by the US withdrawal could undermine diplomatic efforts to end Syria's eight-year civil war and undercut the United States' leverage in the region as well as leave it few options if IS surges again.

"ISIS hits us they are doomed!" Mr Trump tweeted, using an acronym for Islamic State.

IS, which declared its so-called caliphate in 2014 after seizing large areas of Syria and Iraq, was down to its last 1% of the territory it once held in Syria and has no territory in Iraq, a senior US official last week.

But US officials have warned that retaking territory is not the same as defeating the militants.

In a campaign to defeat the group in Syria, former US president Barack Obama ordered air strikes from September 2014 and then troops into the country the following year.

Some US lawmakers, including some Democrats, backed yesterday's announced withdrawal but said Congress needed to play a larger role in overseeing such military operations.

Russian President Vladimir Putin welcomed Mr Trump's decision and said he largely agreed that IS had been defeated.

Mr Trump, however, said Russia - as well as Iran and Syria - were unhappy about the US withdrawal "because now they will have to fight ISIS and others, who they hate, without us".

Democratic US Senator Chris Murphy said Mr Trump's statements appeared in conflict: "Wait a minute... I thought we defeated ISIS. Why would Russia, Iran and Syria have to fight them if they’re defeated?" he tweeted in reply to Mr Trump.