Defense Secretary Jim Mattis said Monday that U.S. troops are in Syria and Afghanistan for the long haul to leverage a diplomatic solution to the ongoing conflicts in both countries.

At an off-camera session with Pentagon reporters, Mattis strongly suggested that President Donald Trump had put aside his initial impulse for quick withdrawals and would maintain an indefinite presence of U.S. ground troops in Syria and Afghanistan.

In Syria, "We do not want to simply pull out before the diplomats have won the peace," Mattis said. "You win the fight, and then you win the peace.”

Mattis did not minimize the difficulties of negotiating peace among numerous warring factions in Syria.

"This is the most complex security situation, fighting situation, whatever you want to call it, that I've experienced in four decades of government service," he said. "So we're still working it."

Mattis said his first stop after leaving the briefing was to meet with Staffan de Mistura, the United Nations special envoy for Syria, on the prospects for reviving Geneva peace talks to end the seven-year-old Syrian civil war, which has killed more than 400,000 and displaced millions.

The SecDef said the U.S. has a similar commitment to Afghanistan, where twin suicide bombings Monday killed at least 25, including nine journalists who rushed to the scene after the first bomb went off.

The attack in Kabul was the latest in a wave of bombings across Afghanistan by the Taliban and an offshoot of the Islamic State of Iraq and Syria that has triggered protests against the shaky central government of President Ashraf Ghani.

However, Mattis said the bombings were signs of desperation by the militants and insisted that the new strategy approved by Trump last August of increased airpower and intensified training for local forces is having success.

He said the new U.S. strategy, combined with the resilience of the Afghan national security forces, has put the Taliban "on their back foot.”

“We anticipated they would do their best" to disrupt upcoming elections with a wave of bombings aimed at discouraging the Afghan people from voting, Mattis said.

"The Taliban realize the danger of the people being allowed to vote," he added. "Their goal is to destabilize the elected government. This is the normal stuff by people who can't win at the ballot box. They turn to bombs.

"This should be completely expected," he said. "It's what they do."

-- Richard Sisk can be reached at Richard.Sisk@Military.com.