ISTANBUL — President Trump said Monday that a limited number of U.S. troops will remain in Syria to man a garrison on the southern border with Jordan and “to secure the oil” elsewhere in the country.

“I don’t think it’s necessary, other than we secure the oil,” Trump said of the U.S. military presence. “We need to secure the oil.” A “small number of troops” would also remain in southern Syria at the request of Israel and Jordan, he added in remarks to reporters at a meeting of his Cabinet in Washington.

The decision to leave more than 20 percent of the U.S. force in Syria behind was the second time in less than a year that Trump announced a complete withdrawal, only to walk it back under heavy bipartisan criticism from lawmakers and disquiet within his own administration.

Earlier Monday, Defense Secretary Mark T. Esper said that a “residual force” of U.S. troops around the oil fields in eastern Syria was under discussion at the Pentagon, but that the proposal to keep troops “in some cities” in Syria had not yet been presented to the president.

A U.S. official with knowledge of Syria operations said the proposal calls for 200 U.S. troops to remain in the oil-producing area, both to keep it out of the hands of the Islamic State and to prevent it from being claimed by the Syrian government, which is steadily recovering territory with backing from Russia and Iran.

Esper spoke during a visit to Afghanistan, as a large U.S. military convoy withdrew from a region of northeastern Syria where Turkey is seeking to establish a buffer zone.

Videos that circulated online showed some residents in northern Syria heckling the soldiers and pelting the vehicles, most flying large American flags, with objects said to be rocks and rotten vegetables.

Last December, Trump said that all of what were then more than 2,000 troops in Syria were coming home, a decision he was compelled to modify under harsh criticism. Ultimately, about half the force was withdrawn. His announcement early this month that all 1,000 remaining troops were leaving cleared the way for a Turkish military offensive in northeastern Syria and led to charges he was abandoning Syrian Kurdish allies and capitulating to Turkey. The Kurdish forces have suffered thousands of casualties while helping beat back the Islamic State.

Turkey regards the Kurdish-led militias in Syria as a security threat because of their links to a Kurdish militant group that has fought a decades-long insurgency in Turkey.

A cease-fire agreement reached by the United States and the government of Turkish President Recep Tayyip Erdogan on Thursday committed Turkey to a five-day pause in the offensive to allow the Syrian Kurdish fighters to withdraw from a 20-mile deep zone inside Syria along the Turkish border.

Turkey and the Kurdish-led Syrian Democratic Forces (SDF) have accused each other of violating the cease-fire’s terms, while U.S. officials have said the truce is generally holding.

Trump has repeatedly pledged to stop U.S. involvement in “endless wars” in the Middle East. At Monday’s Cabinet meeting, Trump said that “we never agreed to protect the Kurds . . . for the rest of their lives.”

“I got elected on bringing our soldiers back home,” he said. Repetition of that pledge, he said, brought the “largest cheer” during a political rally in Dallas last week.

Despite Trump’s vow, however, the number of troops in the region remains more or less the same as it was when he entered office. Trump withdrew half of the 2,000-strong U.S. contingent in Syria this year. But the Pentagon announced earlier this month that it was sending 1,800 additional troops to Saudi Arabia after attacks on two oil facilities there that the United States has blamed on Iran.

Trump deployed thousands of additional troops to Afghanistan in 2017, but said in August that withdrawal plans would bring the number down to about 8,600, where it was in early 2017.

Rather than returning to the United States, Esper said Sunday, the plan for troops withdrawing from Syria was to “reposition [them] in western Iraq. . . . That’s the game plan right now.”

Trump, asked whether those troops were “coming home,” said, “Well, they’re going to be sent initially to different parts and get prepared, then ultimately we’re bringing them home, yeah.” He said that “we’ve been asked by Israel and Jordan to leave a small U.S. force in a totally different section of Syria,” believed to be the Tanf garrison near the Jordanian border, where 100 to 150 U.S. troops are based.

Sen. Lindsey O. Graham (R-S.C.), a Trump ally, said Sunday that the United States wants to establish a zone, patrolled by international forces with U.S. air support, between Turkish and Kurdish forces. But a U.S. official with knowledge of Syria operations, who spoke on the condition of anonymity to discuss operational matters, said that such a separation zone was unlikely.

“No other countries have signed up to be in that zone,” the official said. “It is all talk right now.” Both Britain and France have had special operations forces on the ground in Syria working with U.S. troops there, but have indicated they would not remain if U.S. forces left.

Graham, who had criticized the administration for its handling of the Turkish offensive, said he was “increasingly optimistic it could turn out well.”

“The big thing for me is the oil fields,” he said on “Fox News Sunday.” “I believe we are on the verge of a joint venture between us and the Syrian Democratic Forces, who helped destroy ISIS and keep them destroyed, to modernize the oil fields and make sure they get the revenue, not the Iranians, not Assad.”

Deliveries of oil from Iran, along with that produced in Syrian government-controlled areas, largely meets the country’s demand of up to 150,000 barrels a day, said David Butter, an associate fellow in the Middle East and North Africa Program at Chatham House.

Oil fields in other parts of Syria, including the Euphrates River valley and northeastern Syria, were under the control of the SDF — and in some places, secured alongside U.S. troops or American contractors, he said. Together, the fields in those regions could produce perhaps 60,000 barrels a day, but it was unclear how much, if any, is being produced at present, he said.

The Islamic State had been able to profit handsomely from Syria’s oil for a time. When the militants controlled large portions of the country and the price of oil was around $100 a barrel, crude was sold to traders or refined in makeshift facilities for local use. “It would be highly embarrassing for the U.S. for ISIS to start up oil operations again,” Butter said. 

DeYoung reported from Washington, and George from Kabul. Dan Lamothe and Missy Ryan in Washington contributed to this report.