President Trump on Monday announced he will not pull out U.S. troops from Afghanistan, saying he’s committed to a new strategy aimed at winning the nation’s longest war.

During a prime-time address to the nation, Trump declared a rapid exit from the war-torn nation would leave a major power vacuum that would create a new safe haven for terrorists — a result he called “predictable and unacceptable.”

The president acknowledged his “original instinct was to pull out,” a reference to his long-held view that the U.S. erred when it entered Afghanistan and that the military should withdraw quickly.

But he said the calculation is different “when you sit behind the desk in the Oval Office," and he has determined the U.S. must continue to fight to prevent the country from becoming a safe haven for groups like al Qaeda and the Islamic State in Iraq and Syria (ISIS).

“The American people are weary of war without victory. I share the American people’s frustration,” Trump said, adding that, “in the end, we will fight and we will win.”

Trump’s speech at Joint Base Myer-Henderson Hall in Arlington, Va., was cast as an announcement of his revised strategy in Afghanistan, but he offered few specifics about his plan.

While the president is widely expected to send roughly 4,000 additional U.S. troops to the country, a recommendation made by the Pentagon, Trump declined to say how many troops he would send or reveal a firm timeline for how long they would serve there.

There are roughly 8,400 American service members currently in Afghanistan. Most troops train and advise the Afghan military, but roughly 2,000 participate in counterterrorism missions. The U.S. had 100,000 troops stationed there until President Obama began to withdraw them in 2010 and 2011.

“We will not talk about numbers of troops or our plan for further military activities,” Trump said. “Conditions on the ground, not arbitrary timetables, will guide our strategy for now on. … I will not say when we are going to attack, but attack we will.”

Trump described his plan as a “shift from a time-based approach to one based on conditions,” linking American aid to greater cooperation from the Afghan government, Pakistan, India and others in the region to fighting terrorism and cutting down corruption.

"Our commitment is not unlimited, and our support is not a blank check," he said.

He indicated that the plan is designed to bring the Taliban, which has inflicted heavy casualties in its fight against the Afghan security forces, to the negotiating table.

Unlike past administrations, the president said he does not seek to encourage Afghanistan to adopt Western-style democracy and institutions — just to ensure it does not become a refuge for extremist groups.

“We are not nation-building again,” he said. “We are killing terrorists.”

Trump’s speech capped off a fierce internal debate inside his administration about what to do with the 16-year-long war, which has now ensnared three American presidents.

They argued the Afghan security forces are too weak to win the fight against the Taliban on their own. They warned a defeat of those forces could open the door to al Qaeda and ISIS to target the U.S. from Afghanistan, like Osama bin Laden did before the Sept. 11, 2001, attacks.

But the president had been resistant to commit new troops and resources to the conflict; he has long seen the war as an unwinnable quagmire and reportedly lashed out at military commanders about the state of the conflict in closed-door strategy sessions.

Trump’s announcement had been delayed multiple times over the past several months as he continued to mull over his decision. The delay had frustrated national security hawks in his own party, who warned the U.S. was wasting precious time as the Taliban made inroads against government forces.

But some lawmakers called the plan a folly and argued the president wasn’t living up to his campaign promises.

Before he entered politics and as a candidate, Trump was deeply critical of the Afghan war. “Let’s get out of Afghanistan. Our troops are being killed by the Afghanis we train and we waste billions there. Nonsense! Rebuild the USA,” he tweeted in January 2013.

But he has also slammed Obama for setting deadlines for withdrawal, arguing it undercut the armed forces’ efforts to stamp out terrorist safe havens. He vowed not to make that same mistake.

"The American people expect to see real reforms, real progress and real results," Trump said. "Our patience is not unlimited. We will keep our eyes open. In abiding by the oath I took on January 20th , I will remain steadfast in protecting American lives and American interests."

- This story was updated at 10:48 p.m.