The Taliban’s return to power ended America’s 20-year effort to build a democratic society in Afghanistan — costing tens of thousands of lives and billions of dollars for a mission that was doomed from the start, a scathing report said Tuesday.

The U.S. Special Inspector General for Afghanistan Reconstruction, or SIGAR, report blasted the U.S. administration for lacking the “necessary mindset, expertise, and resources to develop and manage the strategy to rebuild Afghanistan.”

“If the goal was to rebuild and leave behind a country that can sustain itself and pose little threat to U.S. national security interests, the overall picture is bleak,” special inspector general John Sopko wrote in the report, titled “What We Need to Learn: Lessons from Twenty Years of Afghanistan Reconstruction.”

The report was based on 13 years of oversight work, including 760 interviews with people such as current and former policymakers, military officers and experts.

Though the SIGAR concluded that America’s intervention in Afghanistan had “bright spots,” including lower child mortality rates and higher literacy rates, the report also questioned whether these gains are “commensurate with the U.S. investment or sustainable after a U.S. drawdown.”

The grim assessment came in the wake of chaotic scenes in Afghanistan as citizens try to flee the country and as the Taliban takes over. Critics have called out the Biden administration’s handling of the U.S. military withdrawal, but President Joe Biden on Monday defended his actions and said the mission was never to nation-build.

The SIGAR’s report found that the U.S. government “consistently underestimated the amount of time required to rebuild Afghanistan and created unrealistic timelines and expectations that prioritized spending quickly” which resulted in increased corruption and decreased effectiveness.

The U.S. government spent $145 billion trying to rebuild Afghanistan, the special inspector general said, and has “many lessons it needs to learn” going forward.

The report also found the U.S. government did not understand the Afghan context, including socially, culturally and politically.

Additionally, the SIGAR said “U.S. officials rarely had even a mediocre understanding of the Afghan environment, much less how it was responding to U.S. interventions,” and that this ignorance often came from a “willful disregard for information that may have been available.”

The report raised issues and questions for policymakers to consider moving forward, both with regard to Afghanistan and other countries where the U.S. operates, making clear that much work needs to be done when it comes to dealing with the aftermath of war.

“[A]fter 13 years of oversight, the cumulative list of systemic challenges SIGAR and other oversight bodies have identified is staggering,” the report said.

Among the “bright spots,” Sopko noted in a letter included with the report, is that life expectancy in the country has gone up, as have literacy rates and the per capita GDP, while child mortality rates have gone down. Whether or not these improvements will continue is another story.

“While there have been several areas of improvement—most notably in the areas of health care, maternal health, and education—progress has been elusive and the prospects for sustaining this progress are dubious,” the report said. “The U.S. government has been often overwhelmed by the magnitude of rebuilding a country that, at the time of the U.S. invasion, had already seen two decades of Soviet occupation, civil war, and Taliban brutality.”

In an interview Sunday, Sopko told NPR “we’ve been warning – my little agency – for the last almost 10 years about issues with the [Afghan National Defense and Security Force’s] capabilities and sustainment.”

“All the signs have been there. I mean, we’ve been shining a light on it in multiple reports going back to when I started 2012 about changing metrics, about ghosts, ghost soldiers who didn’t exist, about poor logistics, about the fact that the Afghans couldn’t sustain what we were giving them.”

“The fact that the ANDSF could not fight on their own should not have been a surprise to anyone,” he said.