It has been excruciating to watch the Taliban roll across Afghanistan, undoing in a matter of months two decades of efforts by the Afghan people and the international community to build a decent, secure and functioning state. The Taliban effectively wrapped up their stunning sweep of the country, moving into Kabul recently and prompting President Ashraf Ghani to flee.

The Taliban’s virtually uncontested takeover over Afghanistan raises obvious questions about the wisdom of U.S. President Joe Biden’s decision to withdraw U.S. and coalition forces from the country. Paradoxically, however, the rapidity and ease of the Taliban’s advance only reaffirms that Biden made the right decision — and that he should not reverse course.

The ineffectiveness and collapse of Afghanistan’s military and governing institutions largely substantiates Biden’s skepticism that U.S.-led efforts to prop up the government in Kabul would ever enable it to stand on its own feet. The international community has spent nearly 20 years, many thousands of lives and trillions of dollars to do good by Afghanistan — taking down al-Qaida; beating back the Taliban; supporting, advising, training and equipping the Afghan military; bolstering governing institutions; and investing in the country’s civil society.