Esper said Trump made the order Saturday night for "a deliberate withdrawal of forces from northern Syria," without providing a timeline.
It marks the latest controversial move by Trump, who is being widely criticized for leaving the Kurdish forces to face a possibly devastating Turkish assault and perhaps setting the stage for a resurgence of the Islamic State.
Esper said the US would withdraw less than 1,000 troops, in a separate interview on Fox News Sunday. It was not clear if the troops would be leaving Syria entirely.
Around 50 US troops were previously moved away from Syria's border with Turkey as Ankara prepared for its incursion.
Turkey started its operation on Wednesday, saying it is targeting Islamic State extremists and Kurdish militias, and its forces have been pushing farther south.
"We did not want to get involved in a conflict that dates back nearly 200 years between the Turks and the Kurds and get involved in yet another war in the Middle East," he said on CBS.
Esper said the US learned that Turkey "likely intends to expand their attack further south than originally planned and to the west."
The defence chief added that the Kurds are looking to strike a deal with Russia to protect them from Turkey.
The US has been allied with Syrian Kurds since 2014 in the war against Islamic State, and together they worked to defeat the territorial caliphate. The Kurdish-led force lost some 10,000 people in the war.
Ankara considers the Kurdish militias to be linked to the outlawed insurgent group in their country.
Trump is facing strong criticism from across the political spectrum, who accuse him abandoning a US ally and allowing the possible regrouping of the Islamic State in Syria with a US pullout.
The president faced similar criticism in December when he announced a withdrawal from Syria that eventually led to the resignation of defence secretary Jim Mattis.
Trump's December deceleration was watered down as the US kept around 1,000 troops in Syria.
The Kurds have been holding Islamic State fighters captive since the group lost territorial control in Syria.
Hundreds of family members linked to Islamic State militants Sunday escaped from a camp in northern Syria where fighting between Kurdish militias and Turkish-backed rebels is escalating, Kurdish officials and a war monitor reported.
Treasury Secretary Steven Mnuchin said Turkey is "on warning" over its operation in Syria.
"The president has authorized me to effectively shut down the entire Turkey economy and we can do that at a moment's notice on his command," Mnuchin said when asked. "We can do that at a moment's notice on his command."
In a tweet on Sunday Trump said there is "great consensus" on sanctioning Turkey. "Turkey has asked that it not be done. Stay tuned!"
Senator Lindsey Graham, a Trump ally who has criticized the president over his handling of the Kurds, said it is "imperative that we do not allow Turkey's aggression to lead to the destruction of a valuable ally - the Kurds - and the reemergence of ISIS."
--------------------------------------------------------------------------------------------------