President Biden pledged Friday that the United States will remain committed to Afghanistan after American forces leave the country, but said that after nearly two decades of war, the future of the country is in its own hands.

Long a skeptic of America’s longest war, Biden underscored that the decision to pull out was not up for debate as he received Afghanistan’s fractious leadership for a White House visit that felt like a farewell.

“Afghans are going to have to decide their future, what they want,” Biden said as Afghan President Ashraf Ghani and his governing partner, reconciliation envoy Abdullah Abdullah, sat with him in the Oval Office. “But it won’t be for lack of us being [a] help.”

That promised help is mostly financial and rhetorical, with the military mission begun to avenge the terrorist attacks of Sept. 11, 2001, now closing down. Afghan security forces will be in charge of repelling a newly emboldened Taliban insurgency, as prospects for a reconciliation deal between the Ghani government and the Taliban appear dim.

“The senseless violence has to stop, but it’s going to be very difficult,” Biden said. “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.”

He called both men old friends, and indeed, over the span of the nearly two-decade war, he had met both of them. Ghani was last at the White House in 2015, when Biden was vice president.

Ghani said he respects Biden’s decision to withdraw U.S. forces. Abdullah, Ghani’s former political rival, said nothing and remained off camera for most of the brief portion of the meeting seen by reporters.

“President Biden’s decision has been historic. It has made everybody recalculate and reconsider,” Ghani said in English. “We are here to respect and support it.”

The troop withdrawal Biden ordered in April could be substantially complete early next month. Biden had set a Sept. 11 deadline for ending the U.S. military mission, saying that the war he initially supported had ceased to be in U.S. interests.

“We cannot continue the cycle of extending or expanding our military presence in Afghanistan, hoping to create ideal conditions for the withdrawal, and expecting a different result,” Biden said then.

More than 2,000 U.S. service members have died in Afghanistan in a conflict that has cost trillions but often lacked a clear objective.

Ghani opened his remarks with Biden by acknowledging U.S. military deaths and thanking Biden for American commitment. Tens of thousands of Afghans also died over the same period in a war that will not end with the U.S. departure.

Speaking to reporters later, Ghani said Biden’s decision had been made “not in the spirit of abandonment of Afghanistan, but a new chapter in our relationship.”

Biden has requested $3.3 billion for security assistance to Afghanistan next year, a slight increase over current funding. It is not clear how training of Afghan forces or maintenance of U.S.-made equipment will work from afar.

The U.S. Embassy in Kabul will remain, secured by a force of about 650 military personnel. That is much larger than the typical Marine Corps guard forces assigned to protect embassies, a sign that the administration is safeguarding against potential Taliban attacks or even a possible evacuation of American diplomats down the road.

A Taliban offensive across northern Afghanistan has shown the weaknesses of Afghan security forces, which have uneven readiness and skills despite years of U.S. and NATO training.

Officials in Afghanistan say Taliban attacks have increased since Biden’s withdrawal announcement in April, The Washington Post reported last week. In some areas, local forces have surrendered after negotiations between community elders and the Taliban. In others, departing U.S. troops have destroyed bases or stripped them of anything the Taliban might be able to use.

When he ordered the withdrawal, Biden said he understood the argument that the United States would lose leverage over the insurgents by leaving, but noted that staying had not achieved peace.

“We gave that argument a decade,” Biden said in April. “It’s never proved effective. Not when we had 98,000 troops in Afghanistan, and not when we were down to a few thousand. Our diplomacy does not hinge on having boots in harm’s way, U.S. boots on the ground.”

Ghani and Abdullah had already gone over many of the withdrawal details with Defense Secretary Lloyd Austin during a meeting at the Pentagon earlier Friday.

Ghani smiled when asked by reporters to comment on the U.S. intelligence analysis that his government may fall within six months after U.S. forces leave the country.

“There have been many such predictions and they have all proven, turned out, false,” he replied.

Ghani also denied the notion that the United States is walking away from his country.

“The false narrative of abandonment is just false,” Ghani said.

Austin said the United States “is deeply invested in the security and stability of Afghanistan and in the pursuit of a negotiated settlement,” a reference to largely moribund talks to achieve peace between the Afghan government and the Taliban.

Many longtime Afghanistan analysts have said the Taliban has little incentive to pursue a deal with the Kabul government now and may be running out the clock until U.S. forces are gone.

“We will remain partners with the Afghan government and the Afghan military. And we will continue to work toward our common goal in a new and different way,” Austin said.

Pentagon leaders had initially urged Biden to leave a small force of up to 3,000 in the country to focus on terrorism threats.

After a meeting with Ghani on Thursday, Senate Minority Leader Mitch McConnell (R-Ky.) called on Biden to reverse course.

“President Biden’s decision to withdraw U.S. forces leaves our Afghan partners alone to confront threats that his own top advisors acknowledge are grave and growing worse,” McConnell said in a statement.

“President Ghani and the people of Afghanistan are entitled to wonder why the Biden administration has chosen to abandon the fight and invite even greater terrorist threats,” McConnell said.