President Biden on Thursday forcefully rejected criticism that his decision to pull U.S. troops out of Afghanistan had left the country spiraling toward civil war or headed for an inevitable Taliban takeover, saying hurdles were to be expected and did not undermine the case for withdrawal.

In his first speech on the issue since announcing the decision in April, Biden also pledged to relocate thousands of Afghan interpreters who served alongside U.S. troops and now fear for their lives and the safety of their families, adding that some relocation flights would begin as early as this month.

Biden’s remarks at the White House came as the rapid disintegration of security in Afghanistan, and sweeping gains by the Taliban, threatened to hinder the president’s desire to make a clean break with a two-decade war that has cost trillions of dollars and killed about 2,400 U.S. service members.

Last week, the United States transferred Bagram air base, its most important airfield in Afghanistan, to Afghan forces, a near-final step in the withdrawal that Biden now says will be completed by Aug. 31, the most specific date he’s given so far.

Biden said that he and his advisers had anticipated that difficult challenges would arise during the withdrawal but that focusing on such problems has for too long been a rationale for extending an engagement that was killing Americans but doing little to advance U.S. interests.

“Let me ask those who want us to stay: How many more — how many thousands more Americans, daughters and sons — are you willing to risk?” Biden said from the East Room of the White House, standing in front of the flags of the U.S. military branches. “I will not send another generation of Americans to war in Afghanistan with no reasonable expectation of achieving a different outcome.”

Since U.S. troops began leaving Afghanistan, Taliban fighters have swept across much of the country, encircling provincial capitals and in some cases cutting deals with Afghan troops who have laid down their arms.

Even as Biden was speaking, news spread that the Taliban had seized a major transit route between Afghanistan and Iran. A recent U.S. intelligence assessment said that President Ashraf Ghani’s government in Kabul could fall within six to 12 months of the U.S. departure, potentially creating a humanitarian and security crisis — and a political problem for Biden.

Afghanistan evokes more emotion from Biden than almost any other subject, and he said forcefully Thursday that a takeover by the Taliban was “not inevitable” because the country’s fate was in the hands of Afghanistan’s leaders. He stressed to Ghani in a meeting two weeks ago that “Afghan leaders have to come together and drive toward a future that the Afghan people want,” Biden recalled.

The president said the United States would continue to provide civilian and humanitarian assistance to the country, and he renewed his call for a diplomatic solution between the Afghan government and the Taliban.

“I intend to maintain our diplomatic presence in Afghanistan, and we’re coordinating closely with our international partners in order to continue to secure the international airport,” he said. “And we’re going to engage the determined diplomacy to pursue peace and a peace agreement that will end this senseless violence.”

But negotiations between the Taliban and the Afghan government have been stalled for months, and the removal of the U.S. military deprives Afghan leaders of important leverage.

Critics have warned against abandoning interpreters and other Afghans who helped the American war effort, and Biden told them Thursday that “there is a home for you in the United States if you so choose.” But his administration released few details.

The U.S. military action in Afghanistan began in the months after the terrorist attacks of Sept. 11, 2001, as President George W. Bush sought to root out a Taliban regime that had provided a staging ground for al-Qaeda to plan its attack on the United States. Biden’s decision to end the engagement has won support in both political parties — but the criticism has been bipartisan as well, especially from those who fear that pulling out will bolster the Taliban.

Sen. Jeanne Shaheen (D-N.H.) said she was encouraged by the president’s efforts to get Afghan allies out of harm’s way but is deeply concerned about the deterioration of security in Afghanistan.

“Sadly, this follows a trajectory that I feared: a resurgence of the Taliban and direct threats to communities vulnerable to their violence and oppression,” she said, calling for a plan “to maintain the progress made to advance women’s rights and to ensure the safety of our allies who risked their lives, and the safety of their families, in support of the U.S. mission.”

Sen. Lindsey O. Graham (R-S.C.) likened Biden’s announcement to the “Iraq withdrawal debacle,” when an initial U.S. pullout led to a resurgence of violence, and said the president made his decision against “sound military advice.”

“President Biden does not understand conditions are developing in Afghanistan for a reemergence of al-Qaeda and ISIS which will directly threaten the American homeland and our allies,” he said in a lengthy tweet thread. “Get ready for major upheaval as this decision by President Biden is a disaster in the making.”

Some military analysts, however, argue that the Taliban is now at odds with al-Qaeda and the Islamic State and that the scenario that Graham envisages is unlikely to develop. And Biden said Thursday that for some, it would never be the right time to end the U.S. engagement.

“In 2011, our NATO allies and partners agreed that we would end our combat mission in 2014. And in 2014, we signed on for one more year,” Biden said. “So we kept fighting, kept taking casualties. In 2015, the same, and on and on. Twenty years of experience has shown, and the current situation only confirms, that just one more year of fighting in Afghanistan is not a solution.”

He also dismissed suggestions that the withdrawal from Afghanistan carries echoes of the United States’ humiliating exit from Vietnam in 1975.

“There’s going to be no circumstance for you to see people being lifted off the roof of an embassy of the United States from Afghanistan,” Biden said, referring to the evacuations by helicopter of thousands of Americans and South Vietnamese from Saigon in 1975. “It is not at all comparable.”

Still, Gen. Austin “Scott” Miller, the top U.S. military commander in Afghanistan, expressed concern last month that the country could slide into civil war. He said the country could face “very hard times” unless its fractious civilian leadership united and the armed groups battling the Taliban were made “accountable” for their actions.

While dismissing comparisons with Vietnam, Biden on Thursday also rejected the notion that he was engaging in a “Mission Accomplished” moment. Bush in 2003 triumphantly declared success in Iraq standing before a banner carrying that slogan, an image that came back to haunt him as violence surged in Iraq and U.S. casualties mounted.

“There’s no ‘Mission Accomplished,’ ” Biden said. “The mission was accomplished in that we got Osama bin Laden, and terrorism is not emanating from that part of the world.” Bin Laden, the al-Qaeda leader, was killed in 2011 when U.S. forces raided his hideout in Pakistan, where he had evaded an international manhunt for nearly a decade.

The fate of interpreters and others who aided the U.S. military has been one of the central concerns during the pullout, and Biden stressed that they would not be abandoned.

John Kirby, a Pentagon spokesman, said the Defense Department is looking at military installations overseas that it can use to temporarily house interpreters and their families. He declined to name the sites but said that senior defense officials will seek flexibility to accommodate a number that could fluctuate.

“There’s not one part of the world that we’re solely focused on where we could house some of these individuals,” Kirby said. “It’s truly sort of a global look.”

Among the options on the table are military installations in the Middle East and Guam, an administration official said, speaking on the condition of anonymity because of the sensitivity of the issue.

Kirby said chartered flights would be the “preferred option” for relocating the interpreters.

Keith Saddler, a senior official with the nonprofit organization No One Left Behind, which advocates for the safety of the interpreters, said that he was glad to hear Biden commit to helping the interpreters, although he wanted additional specifics.

“I would like to hear more details about when, how and where they will be adjudicated so that we can prepare to support them when they get to the United States,” Saddler said.

Earlier this year, Biden committed to withdrawing nearly all U.S. troops from Afghanistan by Sept. 11 — the 20th anniversary of the terrorist attacks — but the process has been faster than anticipated. After the withdrawal, anywhere from 650 to 1,000 U.S. troops are expected to remain in the country to guard the U.S. Embassy and the airport in Kabul.

American troops were last killed in Afghanistan on Feb. 8, 2020, when two Special Forces soldiers — Sgt. 1st Class Javier Jaguar Gutierrez and Sgt. 1st Class Antonio Rey Rodriguez, both 28 — were killed by gunfire in an attack on their unit. A few weeks later, the Taliban stopped targeting U.S. forces after a deal with the Trump administration that called for all U.S. troops to leave Afghanistan by May of this year.

While the Biden administration did not meet that deadline, the Taliban continued to hold fire as the president considered how to disentangle the United States from the war. Proponents of continuing U.S. operations, such as retired Gen. David Petraeus, have cited that fact, contending that if no Americans are being attacked, there is no harm in staying.

But most military experts expect that the cease-fire will not continue if the United States revisits its decision to leave.

A poll taken shortly after Biden announced the pullout showed it to be fairly popular. In a Quinnipiac survey in late May, 62 percent of Americans said they approved, while 29 percent disapproved and 9 percent offered no opinion.

Felicia Sonmez, Alex Horton, Miriam Berger and Siobhán O’Grady contributed to this report.