President Donald Trump on Wednesday said that he is prepared for a lengthy shutdown, and said he would do "whatever it takes" when asked how long he would wait to get the $5 billion he has demanded for his US-Mexico border wall.

The holdout has triggered a partial shutdown of the federal government which is now in its fifth day.

Speaking from a surprise visit to the troops in Iraq, Trump blamed the shutdown on Nancy Pelosi (D-CA), who is expected to assume the role of Speaker of the House on January 3.

Trump also defended his decision last week to pull US troops out of Syria - a move which led to the abrupt resignation of Defense Secretary James Mattis and leading US diplomat Brett McGurk.

"I think a lot of people are going to come around to my way of thinking. It’s time for us to start using our head," Trump told reporters at the Al Asad Air Base located west of Baghdad, where he and first lady Melania Trump spent approximately three hours on the ground with US troops.

Trump added that he has no plans to withdraw US troops from Iraq, however, adding "In fact we could use this as the base if we wanted to do something in Syria."

Trump told us he has "no plans at all" to pull U.S. forces out of Iraq, says it can be used as a base for remaining ISIS in Syria. ⁰"If we see something happening with ISIS that we don't like, we can hit them so fast and so hard they really won't know what the hell happened." — Jennifer Epstein (@jeneps) December 26, 2018

The President also noted that he was in no rush to replace Mattis - and that Deputy Defense Secretary Patrick Shanahan, who Trump named on Sunday as a temporary successor to begin on January 1, "could be there for a long time."