US President Donald Trump reaffirmed, in an interview airing on Sunday, his determination to pull US troops out of “endless wars” in Syria and Afghanistan, but said they should stay in Iraq to watch Iran.

Trump cited the high cost in blood and money after years of fighting in Afghanistan, in arguing for a US withdrawal from the place where the 9/11 attacks were hatched.

“It's time,” he said in the interview with CBS's “Face the Nation.” “And we'll see what happens with the Taliban. They want peace. They're tired. Everybody's tired.”

US officials have been holding talks in Qatar with the Taliban on a framework for peace negotiations, raising prospects for a breakthrough in the 17-year-old conflict.

On Syria, Trump said the 2,000 US troops in the country would leave “in a matter of time” but cited the need to protect Israel “and other things that we have” for slowing down after initially announcing an immediate pull-out.

He said he will soon be announcing the recapture of “100 per cent of the caliphate” once claimed by the Islamic State group in Iraq and Syria.

“We're at 99 per cent right now, we'll be at 100,” said the president, who was expected to make the announcement during his annual State of the Union address on Tuesday.

Take a look: US-Taliban talks: As hopes rise of a deal, what comes next?

He said, however, the United States will not give up its bases in Iraq.

“We spent a fortune on building this incredible base. We might as well keep it. And one of the reasons I want to keep it is because I want to be looking a little bit at Iran because Iran is a real problem,” he said.

“We have an unbelievable and expensive military base built in Iraq. It's perfectly situated for looking at all over different parts of the troubled Middle East rather than pulling up,” he added.

“We're going to keep watching and we're going to keep seeing and if there's trouble, if somebody is looking to do nuclear weapons or other things, we're going to know it before they do,” he said.

Trump's comments come in the face of warnings by US intelligence chiefs that a precipitous US withdrawal from Afghanistan and Syria could allow a resurgence by Al-Qaeda and IS.

On Thursday, the US Senate voted overwhelmingly for a measure sponsored by Mitch McConnell, the Republican majority leader, warning against a “precipitous withdrawal” from Afghanistan and Syria.

Explore: US withdrawal to drag neighbours back into Afghan war, warns report

Trump said he would leave intelligence in Afghanistan “and if I see nests forming, I'll do something about it.”

“We got to get out of these endless wars and bring our folks back home,” he said at another point. “Now, that doesn't mean we're not going to be watching with intelligence. We're going to be watching, and watching closely. “