While the president has visited with troops in the US multiple times since he took office, this was his first visit to a combat zone.
Trump follows a long tradition of presidents visiting troops overseas.
Although the visit took place in considerable secrecy, speculation had been mounting that Trump might make such a trip. The Pentagon is also said to be developing plans to withdraw up to half of the 14,000 American troops still serving in Afghanistan.
The Iraq trip will also go some way to ending criticism over Trump's failure to meet soldiers on the ground, even as he repeatedly touts his support for the military in campaign rallies.
He voiced strong USA support to unite political factions in Iraq, including integrating minority Sunnis into the government.
Trump told reporters he had overruled generals asking to extend the Syria deployment, where about 2,000 U.S. forces and other foreign troops mostly assist local fighters battling the Islamic State jihadist group.
Both of Mr Trump's predecessors, Republican George W Bush and Democrat Barack Obama, made surprise trips to Iraq during their presidencies.
Chasing peace in the middle of war in Afghanistan
The Taliban are fighting to oust foreign forces and defeat the Western-backed Kabul government. The WSJ report, and others by AFP and Reuters, did not specify a timeframe for a withdrawal.
Mattis and other top advisers had cautioned Trump not to order a precipitous withdrawal from Syria, where roughly 2000 U.S. troops enabled a Kurdish-led militia to roll back the self-declared caliphate of the Islamic State.
While on his way to Iraq, someone spotted Trump's plane flying over the United Kingdom and posted on social media with a photo of the VC-25A aircraft. But its political, military and economic situation remains uncertain, and the country continues to experience sporadic bombings, kidnappings and assassinations, which most people attribute to IS. On his last presidential visit in December 2008, Bush had to duck shoes that an Iraqi journalist hurled at him during a news conference in Baghdad.
He visited Afghanistan four times while in office.
The drawdowns - and the abrupt way that they were announced - helped lead to the resignation of Trump's defense secretary, Jim Mattis, who has been one of the administration's key heavyweights. Iraq formally declared victory against the terror group a year ago, but USA troops have remained to help stabilize regions of the country and train Iraqi soldiers.
But critics claim the fight against ISIS is not yet over, and slammed Mr Trump's decision to withdraw the troops.
Trump now finds himself eager to make good on his own promises to wind down USA involvement overseas.
No other top officials or members of Congress were along. We've knocked them out.