The Pentagon chief’s statements came as Donald Trump claimed he was bringing U.S. soldiers home from “endless wars."

United States Secretary of Defense Mark Esper told reporters traveling with him as he left Washington Saturday heading for Afghanistan, that all U.S. troops currently leaving Syria will be sent to Iraq in order to pursue operations against the Islamic State group (IS).

The Pentagon chief’s statements came as President Donald Trump claimed he was bringing U.S. soldiers home from “endless wars” in the Middle East.

Before he arrived ​​​​​in Afghanistan on Sunday, Esper made clear that, according to current plans, the militaries aren’t going back to their country and the U.S. is not departing from the region, suggesting that counterterrorism missions could be conducted from Iraq into Syria.

The official’s remarks are the first to layout where U.S. troops will go as they walk out from Syria. He also said he has spoken to his Iraqi counterpart about the plan to shift around 1,000 troops from Syria into western Iraq.

Yet, Trump tweeted “USA soldiers are not in combat or ceasefire zones. We have secured the Oil. Bringing soldiers home!”

The president declared the past week that Washington had no stake in defending the Kurdish fighters as Turkey conducted a launched an offensive into northeastern Syria against them before a military truce.

“It’s time for us to come home,” Trump said, defending his removal of U.S. troops from that part of Syria and praising his decision to send more troops and military equipment to Saudi Arabia to help the kingdom defend against Iran.

When asked about the fact that his comments were contradicting those of the president and the troops were not coming home, Esper said “Well, they will eventually, ”adding that the troops going into Iraq will have two missions.

“One is to help defend Iraq and two is to perform a counter-ISIS mission as we sort through the next steps,” he said. “Things could change between now and whenever we complete the withdrawal, but that’s the game plan right now.”