President Donald Trump has committed the United States to an open-ended conflict in Afghanistan, reversing course from his campaign pledges and signaling he will send troops to America’s longest war in “a fight to win.”

Trump offered few specifics in a speech on Monday but promised a stepped-up military campaign against Taliban insurgents who have gained ground against U.S.-backed Afghan government forces. He also singled out Pakistan for harboring militants in safe havens on its soil.

“We are not nation-building again. We are killing terrorists,” he said in a prime-time televised address at a military base outside Washington.

The Taliban swiftly condemned Trump’s decision to keep American troops in Afghanistan without a withdrawal timetable, vowing to continue “jihad” until all U.S. soldiers are gone.

“If the U.S. does not pull all its forces out of Afghanistan, we will make this country the 21st century graveyard for the American empire,” Taliban spokesman Zabihullah Mujahid said in a statement.

Trump ran for the presidency calling for a swift U.S. withdrawal from Afghanistan and he acknowledged on Monday that he was going against his instincts in approving the new campaign plan sought by his military advisers.

“The consequences of a rapid exit are both predictable and unacceptable,” he said. “A hasty withdrawal would create a vacuum that terrorists, including ISIS and al Qaeda, would instantly fill.”

Republican Trump, who had criticized his predecessors for setting deadlines for drawing down troops in Iraq and Afghanistan, declined to put a timeline on expanded U.S. military operations in Afghanistan.

Trump now inherits the same challenges as George W. Bush and Barack Obama, including a stubborn Taliban insurgency and a weak, divided government in Kabul. He is laying the groundwork for greater U.S. involvement without a clear end in sight or providing specific benchmarks for success.

U.S. officials said he had signed off on Defense Secretary James Mattis’ plans to send about 4,000 more troops to add to the roughly 8,400 already in Afghanistan.

Mattis said he had directed the chairman of the Joint Chiefs of Staff to carry out the strategy and that he would be consulting with NATO and other U.S. allies, several of which had also committed to increasing troops.

‘NOT A BLANK CHECK’

Trump warned that U.S. support “is not a blank check,” and insisted he would not engage in “nation-building,” a practice he has accused his predecessors of doing at huge cost.

Trump insisted through the speech that the Afghan government, Pakistan, India, and NATO allies step up their own commitment to resolving the 16-year conflict.

“We can no longer be silent about Pakistan’s safe havens,” Trump said. “Pakistan has much to gain from partnering with our effort in Afghanistan. It has much to lose by continuing to harbor terrorists.”

A Pakistani army spokesman said on Monday that Pakistan had taken action against all Islamist militants.

“There are no terrorist hideouts in Pakistan,” spokesman Major General Asif Ghafoor said.

Pakistan sees Afghanistan as a vital strategic interest. Obama sent Navy SEALs into Pakistan to kill al Qaeda chief Osama bin Laden, the architect of the Sept. 11, 2001, attacks that triggered the war in Afghanistan.

The Taliban government was overthrown by U.S.-backed Afghan forces in late 2001 but U.S. forces have been bogged down there ever since. About 2,400 U.S. troops have died in Afghanistan.

Trump expanded the U.S. military’s authority for American armed forces to target militant and criminal networks, warning “that no place is beyond the reach of American arms.”

“Our troops will fight to win,” he said.

“UNFORTUNATE$ TRUTH”

The speech came after a months-long review of U.S. policy in which Trump frequently tangled with his top advisers.

U.S. military and intelligence officials are concerned that a Taliban victory would allow al Qaeda and Islamic State’s regional affiliate to establish bases in Afghanistan, from which they could plot attacks against the United States and its allies just as bin Laden had done.

“The unfortunate truth is that this strategy is long overdue and in the interim the Taliban has made dangerous inroads,” said senior Republican Senator John McCain, chairman of the Senate Armed Services Committee.

Senator Jack Reed, the senior Democrat on the committee, criticized what he called a speech short on details.

Trump suggested he was hoping for eventual peace talks, and said it might be possible to have a political settlement with elements of the Taliban.

He said he was convinced by his national security advisers to strengthen the U.S. ability to prevent the Taliban from ousting Afghan President Ashraf Ghani’s government.

“My original instinct was to pull out,” he said.

Two officials who participated in discussions on Afghanistan said one reason Trump’s policy decision had taken so long was because it was hard to get him to accept the need for a broader regional strategy that included Pakistan.

White House national security adviser H.R. McMaster backed the request for the extra 4,000 U.S. troops, although recently ousted White House strategic adviser Steve Bannon had argued for a total withdrawal.

Breitbart News, the hard-right news site to which Bannon has returned as executive chairman, said on its home page that Trump “reverses course” and “defends flip-flop in somber speech.”