Defense Minister Najah al-Shammari made the remarks to AP on Wednesday, following a meeting with Esper, who arrived in Baghdad a day to discuss the troops.
He said the American troops crossing from Syria are "transiting" in Iraq and will then head either to Kuwait, Qatar or the United States.
Iraq's military said Tuesday that American troops leaving northeastern Syria don't have permission to stay in Iraq in a statement that appeared to contradict Esper, who has said that all US troops leaving Syria would continue to conduct operations against the Daesh group from Iraq to prevent its resurgence in the region.
Esper had said earlier on Wednesday that he plans to talk with Iraqi leaders about the matter.