President Donald Trump said Monday night the United States will ramp up engagement in the 16-year-old war in Afghanistan, despite his "original instinct" to pull American troops out of the country.

In a major address at Virginia's Fort Myer, the president did not detail how many more U.S. troops he would send or specifically what he felt it would take for the U.S. to finally achieve victory in its longest war ever.

Trump, who won the White House in part on a promise to reduce intervention in conflicts overseas, said "the American people are weary of war without victory." But he said he chose to keep troops in Afghanistan based on the consequences of a swift withdrawal, which he said would create a "vacuum" that terrorists would "instantly fill."

"We cannot repeat the mistake in Afghanistan our leaders made in Iraq," Trump told the soldiers gathered for the speech.

"One way or another, these problems will be solved. I am a problem solver. And in the end, we will win," he said.

Trump said he and his advisors decided the way forward on Afghanistan at the Camp David presidential retreat Friday, following a long series of deliberations. Trump had reportedly been reluctant to let U.S. involvement drag on — he repeatedly slammed the Obama administration for staying in Afghanistan as costs and casualties mounted.

Ultimately, the president said his decision came down to three factors:

He wanted an outcome "worthy" of the sacrifices made, "especially the sacrifice of lives."

The president said he feared that terror groups like al-Qaeda and ISIS could fill a void left by U.S. troops.

Trump also said he felt that the U.S. faced "immense" security threats in the region.

"We are not nation building again. We are killing terrorists," Trump said, vowing to defeat terror groups "handily."

The conflict has dragged on for nearly 16 years even after Trump and President Barack Obama won the White House while pledging to roll back U.S. interventionism. Obama said he would pull the U.S. out of Afghanistan, but did not.

About 8,400 American troops are in Afghanistan, down from a peak of about 100,000 in 2010 according to NBC News. Trump was reportedly considering sending up to 4,000 more troops to train and advise Afghan forces in the ongoing counterterrorism fight.

Nearly 2,400 U.S. military personnel have died during the conflict.

Trump did not go into great detail about how his Afghanistan policy would prove more effective than those his predecessors used. He gave broad outlines of how it would change.

Trump said he wants to base his decisions about personnel on conditions on the ground, not on timetables. He also said he will not announce planned movements.

"We will not talk about numbers of troops or our plans for further military activities," Trump said.

At least two top congressional Democrats decried what they called a lack of detail in Trump's strategy.

Defense Secretary Jim Mattis said in a statement that he directed the chairman of the Joint Chiefs of Staff to "make preparations" for Trump's strategy — while stating more clearly than Trump that the U.S. is adding troops in Afghanistan.

"I will be in consultation with the Secretary General of NATO and our allies — several of which have also committed to increasing Pakistan has much to gain from partnering with our effort in Afghanistan. It has much to lose by continuing to harbor terrorists their troop numbers. Together, we will assist the Afghan Security forces to destroy the terrorist hub," Mattis said.

Trump also aims to put more pressure on Pakistan than his predecessor did. He accused the country of harboring terrorists.

"Pakistan has much to gain from partnering with our effort in Afghanistan. It has much to lose by continuing to harbor terrorists," he said.

Trump added that he wants Pakistan-rival India to provide more support in rooting out terrorism in the region.