First lady Melania Trump joined him on the unscheduled Wednesday visit.
Trump visited with U.S. troops stationed in South Korea in Nov. 2017, but he had yet to visit Americans deployed in the Middle East.
Trump’s immediate predecessors each visited troops in the region much earlier: President George W. Bush first traveled to Baghdad in Nov. 2003, roughly eight months after ordering American troops to Iraq.
President Barack Obama, who first visited Iraq as a senator, made his first trip as commander-in-chief in April 2008, roughly three months after taking office.
Trump first visited with troops overseas in Italy in May 2017, roughly four months after taking office.
His visit Wednesday, the day after Christmas, continues a long tradition of presidents visiting with service members at home or abroad during the holiday season. On Christmas Day, Trump participated in a video call with service members serving across the country and overseas during the holidays.
Trump’s visit comes after the president’s decision to withdraw American troops from Syria surprised Washington, blindsiding lawmakers, members of the administration and American allies across the world and on the ground fighting Islamic State in Syria.
On Thursday, the Trump administration announced it was planning to reduce the number of U.S. troops in Afghanistan, cutting the current force of 14,000 service members to 7,000. Those troops could return home by the end of spring, an American official told ABC News.
Defense Secretary James Mattis also resigned Thursday, after the decision was made, having clashed with the president over policy and their divergent worldviews and philosophies on American military power.
While his resignation letter said he would stay on until the end of February to ensure a smooth transition, Trump moved up the timeline, forcing Mattis out of the administration by the end of the year.
Deputy defense secretary Patrick Shanahan, a former Boeing executive with no prior military or government experience, will replace the retired Marine in an acting capacity.