The Biden administration moved slowly for months to address the plight of vulnerable Afghans who had worked for the United States even as a deadline for U.S. military withdrawal loomed, refugee advocates said — a lull some blamed on White House concern that the influx would invite partisan political backlash amid a rush of migrants at the southern border.

Afghans who served as interpreters, fixers and other staff for the U.S. military and diplomats over the nearly 20-year U.S. military mission were among thousands evacuated in recent days, following the stunning collapse of the U.S.-backed government. Getting thousands more out of the country is a top priority now ahead of an Aug. 31 deadline to exit, the nation’s top military officials said Wednesday.

“We have a moral obligation to help those who helped us, and I feel the urgency deeply,” Defense Secretary Lloyd Austin said at the Pentagon.

Asked Wednesday by ABC News’ George Stephanopoulos whether some troops might stay beyond the end of the month if necessary to evacuate Americans and Afghan allies, President Biden said: “It depends on where they are, and whether we can ramp these numbers up to five [thousand] to 7,000 a day coming out. If that’s the case, they’ll all be out.”

Biden also said, “If there are American citizens left, we’re going to stay until we get them all out.”

But the administration showed little public urgency to expedite visas for Afghans in the months before and immediately after Biden’s announcement in April that the United States would pull U.S. forces out. White House officials said bureaucratic backlogs and delays caused by the coronavirus pandemic slowed the process but that it ramped up dramatically as summer approached.

The State Department approved 137 visas between Jan. 1 and March 31, resulting in more than 650 people approved for relocation to the United States. Successful applicants for what is known as special immigrant visas, or SIVs, can bring immediate family members. The pace picked up after that, and the State Department says it reached a rate of 800 per week at the start of August, just before the Taliban takeover of the country and the shuttering of the U.S. Embassy in Kabul.

“At every stage the administration expressed nominal support for the SIV program” while saying that bureaucratic hurdles prevented faster work, said Rep. Peter Meijer (R-Mich.), who is part of a bipartisan group of lawmakers that pushed the White House to move more quickly.

“At every point that had an excuse thrown up, we went and fixed that excuse,” Meijer said. “So at the end of the day I can’t help but come to the conclusion that they just didn’t want to deal with this issue and put up every roadblock possible.”

“They were worried about the optics because they lost control of the southern border,” he said, accusing the administration of “leaving our Afghan friends out to hang in the wind.”

James Miervaldis, chairman of No One Left Behind, a nonprofit group that helps former translators and others navigate the visa process, described months of inconclusive conversations with administration officials this spring. Advocates warned “that this could go bad very fast” and that the administration needed contingency plans to move people within Afghanistan and exit strategies to third countries, such as Qatar, if they could not immediately relocate to the United States, Miervaldis said.

“There was a very proactive campaign from outside groups trying to help, and we were stiff-armed. All we asked for was a plan. Whatever they wanted to do, we were standing by to support. But then they didn’t do anything,” right away, Miervaldis said.

Although he said none of the officials he dealt with asserted a connection to immigration politics, Miervaldis believes there is one.

“There are people looking at what is happening at the border and saying, ‘Oh we can’t all of a sudden be bringing in refugees from Afghanistan, people will hammer us on immigration,’ ” Miervaldis said.

A senior administration official denied foot-dragging or a political motive.

“This is not true. We would never let the prospect of bad-faith criticism from the same people who orchestrated the Muslim ban and decimated America’s refugee pipeline keep us from keeping faith with our Afghan partners,” said the official, speaking on the condition of anonymity because of sensitivity of the matter.

Officials provided a timeline of administration action that noted a backlog of 17,000 SIV applicants when Biden took office. In-person interviews were required but none had taken place at the U.S. Embassy in Kabul since March 2020, administration officials said. Interviews resumed within two weeks of Biden’s inauguration, and in February the White House issued an order directing additional resources for visa processing.

Eventually the administration committed four times as many people to the task of processing as before, administration officials said.

As lawmakers and advocates were pressing the Biden administration to expedite the SIV process, the White House was embroiled in an immigration crisis at the southern border. Biden was growing increasingly frustrated with his administration’s struggle to handle the influx of unaccompanied minors and worried about the government’s ability to handle an influx of refugees from other countries.

Even though they are separate processes, the Office of Refugee Resettlement, housed at the Department of Health and Human Services, has responsibility for both unaccompanied minors at the border and the separate group of foreigners seeking refugee status because of persecution, war or oppression at home. The Afghan SIVs, however, are not part of the U.S. refugee cap.

Early in his term, Biden overruled his top foreign policy and national security advisers, including Secretary of State Antony Blinken, in deciding to keep in place the Trump administration’s record-low cap on the number of refugees admitted to the United States.

The move was reversed after public outcry, but Biden’s initial decision reflected his concerns about how the crisis at the border affected the broader refugee landscape. Biden himself acknowledged there were geopolitical considerations for not evacuating Afghans sooner.

“Part of it was because the Afghan government and its supporters discouraged us from organizing a mass exodus to avoid triggering, as they said, a crisis of confidence,” the president said Monday.

Shortly after Biden announced his withdrawal plan on April 13, a group of bipartisan lawmakers created the Honoring Our Promises Working Group to pressure the administration to protect Afghan allies and expedite the SIV process.

The administration’s first meeting with the working group did not come until May 13, followed by a second meeting at the beginning of June, according to a source familiar with the process.

Acting on a suggestion from the administration, the working group quickly drafted the Hope for Afghan SIVs Act of 2021, which waived requirements to undergo a medical exam for those eligible for special immigrant status, followed by the Averting Loss of Life and Injury by Expediting SIVs (ALLIES) Act, a bill designed to expedite the SIV process by removing burdensome application requirements. But the meetings did not come soon enough, according to Democrats and Republicans involved with the process.

“From our perspective we’d say it took too long but we do think they got there with us,” said a person familiar with the process, who spoke on the condition of anonymity to candidly describe negotiations with the White House.”

The Pentagon has said it may soon be able to evacuate more than 5,000 per day, if the Taliban holds to an unofficial agreement not to interfere.

Advocates began raising the fate of Afghan interpreters and others with Biden’s team behind the scenes even before the new president took office, urging swift action to members of committees set up to conduct planning on issues including immigration. While President Donald Trump had ordered the Pentagon to reduce U.S. force levels to 2,500 by Jan. 15, they also knew he might institute an abrupt withdrawal at any time.

In May, advocates began to publicly call for the administration to move SIV candidates and their families to a U.S. territory such as Guam.

There was precedent for doing so: In 1975, the United States moved more than 100,000 Vietnamese allies to the island, most of whom eventually settled in the United States.

On May 19, Sen. Jeanne Shaheen (D-N.H.) and Sen. Joni Ernst (R-Iowa), along with a group of bipartisan lawmakers, sent a letter to Biden urging his administration to ensure the SIV program had the capacity to bring Afghans who assisted American forces to safety amid the U.S. withdrawal.

But ultimately the legislative changes were largely “in the weeds,” rather than a necessary systemic overhaul made more urgent by the approaching deadline, said one Senate aide, who spoke on the condition of anonymity because they were not authorized to speak publicly.

In May, Biden officials conveyed they believed they had at least a year before there was a serious threat to individuals in Kabul, the aide said.

But Senate aides also blamed Trump for allowing the SIV program to atrophy, which they said resulted in the Biden administration inheriting a program that was not operating at full capacity. White House officials echoed that critique.

The Afghan SIV program continued throughout Trump’s four-year presidency, although applicants faced wait times stretching years.

Humanitarian aides and experts working on the issue have struggled to find explanations for the seemingly slow response apart from political factors.

“The Biden administration has been looking over its shoulder at the southern border and worries that politically this is an area where demagogues can score points as Trump did when he was running for president,” said Bill Frelick, refugee policy director for Human Rights Watch. “I think the Biden administration realizes that the asylum issues on the Southern border can easily be conflated with refugee resettlement.”

The premise that refugees were popular with the American public pre-Trump is misguided, according to Celinda Lake, a pollster for the Biden campaign.

“For decades refugees have been less popular than immigrants,” Lake said. “That doesn’t mean Trump didn’t heighten anti-refugee sentiment but there’s a basic premise that refugees have always been popular and that’s very rare.”