Australian troops will remain in the Middle East despite US President Donald Trump announcing the withdrawal of thousands of soldiers from Syria and Afghanistan in a move that has shocked his Western allies and forced the sudden resignation of his Defence Secretary, Jim Mattis.

Prime Minister Scott Morrison said Australia's presence "will remain" in the region, where more than 600 troops continue to conduct operations and train local troops in Iraq and Afghanistan.

"We have to be conscious of the potential for a resilient and a resurgent [Islamic State]," he said. "We're in regular dialogue, we're engaging with the US about what their plans are and to ensure there can be some alignment with both their thinking and planning."

Prime Minister Scott Morrison during a visit to Task Group Taji at Taji Military Complex in Iraq. Credit:David Mariuz

The Coalition is set to frame the looming election around the economy and national security – areas which voters give the Morrison government credit for over Labor – amid an otherwise perilous route back to government.