WASHINGTON — During a meeting Friday at the White House, President Biden sought to reassure Afghanistan’s leaders of his enduring commitment to their country after U.S. forces are withdrawn later this year, the prospect of which has already emboldened Taliban militants.

“The partnership between the United States and Afghanistan is not ending,” Biden said in comments before the start of his meeting with Afghan President Ashraf Ghani and Abdullah Abdullah, chairman of the High Council for National Reconciliation. Yet he put the onus on Afghans to determine their fate.

“Afghans are going to have to decide their future, what they want,” Biden said. “It’s going to be very difficult. But we’re going to stick with you, and we’re going to do our best to see to it you have the tools you need.”

Ghani said he respected Biden’s decision to withdraw U.S. forces and paid tribute to the 2,312 Americans who died fighting in Afghanistan over two decades. He also acknowledged the Taliban’s recent gains, stating casually that “things happen” in moments of transition, but he vowed that his country’s fledgling democracy will endure.

“We are determined to have unity, coherence,” Ghani said. “You will see: With determination, with unity and with the partnership, we will overcome all odds.”

But such resolute words — and Biden’s promises of diplomatic, economic and humanitarian assistance — can’t obscure the reality that Afghanistan is at a crossroads and facing an uncertain future.

Since Biden’s April announcement that all U.S. troops would leave Afghanistan by Sept. 11, making good on his campaign promise to end America’s longest war after nearly 20 years, a Taliban blitz has overtaken dozens of districts. Among them are areas on Afghanistan’s northern border with Tajikistan, a key supply route. The Taliban has also made gains across the northern provinces of Kunduz, Balkh and Baghlan.

Ghani told reporters in the Oval Office that Afghan security forces Friday had retaken six districts.

The Taliban gains have been accompanied by reports of Afghan troops surrendering en masse. In recent days, activists have posted videos of weary soldiers walking sheepishly across the front lines, shaking the hands of waiting Taliban fighters and surrendering their arms — a result, some allege, of tribal elders negotiating with the Taliban ahead of what many fear will be a rout of government forces.

Open-source analysts scouring social media contend that the government has lost hundreds of U.S.-supplied heavy weapons, armored vehicles and trucks, with almost 200 Humvees captured by the Taliban since June. Four helicopters have been downed.

Those incidents have sparked urgent questions about the viability of the U.S.-backed and -trained Afghan army and its associated militias after September. The Wall Street Journal recently reported that U.S. intelligence officials believe the Afghan government could collapse within six months after American and NATO forces leave.

According to the White House, the Pentagon’s Afghanistan Security Forces Fund will provide financial support to the country’s national army and its police, air force and special security forces. The fund includes more than $3 billion for the current fiscal year, which ends Sept. 30, and Biden has asked Congress to provide $3.3 billion for 2022.

The White House noted that the U.S. has provided an additional $300 million in civilian assistance for Afghanistan in 2021, and Biden has requested an additional $364 million in development assistance for 2022.

Deborah Lyons, the United Nations’ special representative for Afghanistan, painted a grim picture of the situation earlier this week in remarks to the U.N. Security Council, suggesting that the Taliban’s gains may be just the start of its offensive.

“Most districts that have been taken surround provincial capitals, suggesting that the Taliban are positioning themselves to try and take these capitals once foreign forces are fully withdrawn,” she said.

A paramount concern is whether the government can retain any of the thousands of contractors it relies on for everything from procuring bullets and fuel to making payroll. Before the withdrawal began, the number of contractors had swelled to 18,000; it is set to “go to zero” by September, according to a U.S. Army document.

Biden, responding to a question Thursday at the White House, said the U.S. “has already begun the process” of issuing special immigrant visas to thousands of Afghan translators who have aided the American effort and are trying to flee the country to escape possible retribution by the Taliban.

“Those who helped us are not going to be left behind,” he said, noting that he would be discussing the specifics of the plans with Ghani on Friday.

Members of both parties in Congress have been pushing the White House to do more, introducing legislation Thursday that would expedite visas for Afghans and increase the number available to 19,000 from 11,000.

Secretary of State Antony J. Blinken acknowledged Friday during a visit to Paris that the United States had to look “very hard” at whether the Taliban is serious about peacemaking. But he suggested that the continued presence of U.S. troops would not help, saying, “The status quo was not an option.”

The Taliban, meanwhile, shows no interest in negotiations. In a statement released Wednesday, the group spoke with the confident tone of a government-in-waiting, reassuring citizens “that none will be treated in a discriminatory, vindictive, condescending or hostile manner” and inviting “troopers, police, militias and workers standing in enemy ranks to embrace the open arms of the Islamic Emirate.”

The Taliban also promised to keep border ports operational and to allow unobstructed cross-country movement. For those who would still fight the Taliban, however, the group will “deprive them of amnesty,” the statement said.

In the United States, despite qualms about the withdrawal — and painful memories of the one from Vietnam more than four decades ago — groups backing Biden’s decision argue that the move is long overdue.

“It’s true Afghan security forces will struggle to hold ground in a post-U.S. Afghanistan,” said retired Lt. Col. Daniel L. Davis, a senior fellow at Defense Priorities, a national security think tank in Washington. “But the alternative of keeping U.S. forces in the country to prop them up will not solve their problems.”

Stokols reported from Washington and Bulos from Beirut. Times staff writer Tracy Wilkinson in Paris contributed to this report.