WASHINGTON (Reuters) - President Donald Trump told Americans on Tuesday his administration had accelerated talks for a political settlement in Afghanistan and would be able to reduce U.S. troops there as negotiations advance to end America’s longest war.

“Great nations do not fight endless wars,” Trump said in his annual State of the Union address to Congress, in which he also said U.S. troops had nearly defeated Islamic State militants in Syria and it was time to bring them home.

After 17 years of war in Afghanistan, Trump praised “the unmatched valor” of U.S. forces.

“Thanks to their bravery, we are now able to pursue a possible political solution to this long and bloody conflict,” Trump said.

He said his administration was holding constructive talks with a number of groups, including Taliban militants.

“As we make progress in these negotiations, we will be able to reduce our troop presence and focus on counter-terrorism. And we will indeed focus on counter-terrorism,” Trump said.

Trump offered no specifics about when he would bring home the 14,000 U.S. troops now in Afghanistan.

U.S.-led forces in 2001 toppled the hardline Taliban for harboring the al Qaeda militants responsible for the Sept. 11 attacks.

“We do not know whether we will achieve an agreement - but we do know that after two decades of war, the hour has come to at least try for peace,” Trump said.

‘END MILITARY PRESENCE’

The Taliban, responding to Trump’s speech, rejected any suggestion of a lingering U.S. focus on counter-terrorism after troops are drawn down, reiterating their long-held demand that all foreign troops get out.

“At the first step, we want all the foreign forces to leave and end the military presence in our country,” Sohail Shahin, a spokesman for a Taliban office in Qatar, said by telephone.

“But after ending their military presence, their non-military teams can come and ... take part in the reconstruction and development process.”

FILE PHOTO: U.S. troops patrol at an Afghan National Army (ANA) Base in Logar province, Afghanistan August 7, 2018. REUTERS/Omar Sobhani/File Photo

In December, a U.S. official said Trump was planning to withdraw more than 5,000 U.S. troops in Afghanistan, triggering worries about whether a smaller force would be able to fulfill missions under way and stabilize the country.

When he campaigned for president in 2016, Trump said he wanted to focus more on domestic issues than foreign conflicts.

However, Trump’s sudden announcement in December that he would withdraw U.S. forces from Syria alarmed allies and many current and former U.S. officials, who worry that Islamic State militants remain a threat.

After the speech, Democratic Representative Eliot Engel, chairman of the House of Representatives Foreign Affairs Committee, said Trump’s Syria plans did not seem well thought out and could put U.S. allies like the Kurds and Israel at risk, while empowering Iran.

“We’ll probably come back at a future date, with much more danger to our troops,” Engel told Reuters.

Earlier on Tuesday, General Joseph Votel, head of the military’s Central Command, warned that Islamic State would pose an enduring threat.

In his address, Trump said Islamic State controlled more than 20,000 square miles of territory in Iraq and Syria. “Today, we have liberated virtually all of that territory from the grip of these bloodthirsty monsters,” he said.