All told, the cost of nearly 18 years of war in Afghanistan will amount to more than $2 trillion. Was the money well spent?

There is little to show for it. The Taliban control much of the country. Afghanistan remains one of the world’s largest sources of refugees and migrants. More than 2,400 American soldiers and more than 38,000 Afghan civilians have died.

Still, life has improved, particularly in the country’s cities, where opportunities for education have grown. Many more girls are now in school. And democratic institutions have been built — although they are shaky at best.

Drawing on estimates from Brown University’s Costs of War Project, we assessed how much the United States spent on different aspects of the war and whether that spending achieved its aims.

$1.5 trillion waging war The Taliban control or contest much of the country.

Mazar-i-Sharif Kunduz Baghlan Kabul Afghanistan Herat Ghazni Taliban Presence by District, Dec. 2019 Lashkar Gah Kandahar Control Contested 100 Miles Mazar-i-Sharif Kunduz Baghlan Kabul Afghanistan Herat Ghazni Taliban Presence by District, Dec. 2019 Lashkar Gah Kandahar Control Contested 100 Miles Kunduz Kabul Afghanistan Ghazni Taliban Presence by District, Dec. 2019 Kandahar Control Contested 200 Miles

When President George W. Bush announced the first military action in Afghanistan in the wake of terrorist attacks by Al Qaeda in 2001, he said the goal was to disrupt terrorist operations and attack the Taliban.

Eighteen years later, the Taliban are steadily getting stronger. They kill Afghan security force members — sometimes hundreds in a week — and defeat government forces in almost every major engagement, except when significant American air support is used against them.

Al Qaeda’s senior leadership moved to Pakistan, but the group has maintained a presence in Afghanistan and expanded to branches in Yemen, northern Africa, Somalia and Syria.

The $1.5 trillion in war spending remains opaque, but the Defense Department declassified breakdowns of some of the three most recent years of spending.

Most of the money detailed in those breakdowns — about 60 percent each year — went to things like training, fuel, armored vehicles and facilities. Transportation, such as air and sea lifts, took up about 8 percent, or $3 billion to $4 billion a year.

$10 billion on counternarcotics Afghanistan supplies 80 percent of the world’s heroin.

In a report last year, the Special Inspector General for Afghanistan Reconstruction described counternarcotics efforts as a “failure.” Despite billions of dollars to fight opium poppy cultivation, Afghanistan is the source of 80 percent of global illicit opium production.

Hectares of Opium Cultivated in Afghanistan 2017: 328,000 300 200 100 2002: 84,000 2005 2010 2015 Hectares of Opium Cultivated in Afghanistan 2017: 328,000 300 200 100 2002: 84,000 2005 2010 2015 Hectares of Opium Cultivated in Afghanistan 2017: 328,000 300 200 100 2002: 84,000 2005 2010 2015

Before the war, Afghanistan had almost completely eradicated opium, according to United Nations data from 1996 to 2001, when the Taliban were in power.

Today, opium cultivation is a major source of income and jobs, as well as revenue for the Taliban. Other than war expenditures, it is Afghanistan’s biggest economic activity.

$87 billion to train Afghan military and police forces Afghan forces can’t support themselves.

One of the major goals of the American effort has been to train thousands of Afghan troops. Most of American spending on reconstruction has gone to a fund that supports the Afghan Army and police forces through equipment, training and funding.

But nobody in Afghanistan — not the American military, and not President Ashraf Ghani’s top advisers — thinks Afghan military forces could support themselves.

Strength of the Afghan Security Forces Current target: 352,000 300 thousand troops 2018: 308,700 250 2010 2012 2014 2016 Strength of the Afghan Security Forces Current target: 352,000 300 thousand troops 2018: 308,700 250 2010 2012 2014 2016 Strength of the Afghan Security Forces Current target: 352,000 300 thousand troops 2018: 308,700 250 ’10 ’12 ’14 ’16

The Afghan Army in particular suffers from increasing casualty rates and desertion, which means they have to train new recruits totaling at least a third of their entire force every year.

President Barack Obama had planned to hand over total responsibility for security to the Afghans by the end of 2014 and to draw down all American forces by 2016. That plan faltered when the Taliban took quick advantage and gained ground.

The American military had to persuade first President Obama, and then President Trump, to ramp up forces. Some 14,000 U.S. troops remained in the country as of this month.

$24 billion on economic development Most Afghans still live in poverty.

War-related spending has roughly doubled the size of Afghanistan’s economy since 2007. But it has not translated into a healthy economy.

A quarter or more of Afghans are unemployed, and the economic gains have trailed off since 2015, when the international military presence began to draw down.

Overseas investors still balk at Afghanistan’s corruption — among the worst in the world, according to Transparency International, an anticorruption group — and even Afghan companies look for cheaper labor from India and Pakistan.

Hopes of self-sufficiency in the mineral sector, which the Pentagon boasted could be worth $1 trillion, have been dashed. A few companies from China and elsewhere began investing in mining, but poor security and infrastructure have prevented any significant payout.

$30 billion on other reconstruction programs Much of that money was lost to corruption and failed projects.

American taxpayers have supported reconstruction efforts that include peacekeeping, refugee assistance and aid for chronic flooding, avalanches and earthquakes.

Much of that money, the inspector general found, was wasted on programs that were poorly conceived or riddled with corruption.

American dollars went to build hospitals that treated no patients, to schools that taught no students (and sometimes never existed at all) and to military bases the Afghans found useless and later shuttered.

The inspector general documented $15.5 billion in waste, fraud and abuse in reconstruction efforts from 2008 through 2017.

Thanks to American spending, Afghanistan has seen improvements in health and education — but they are scant compared with international norms.

Afghan maternal mortality remains among the highest in the world, while life expectancy is among the lowest. Most girls still receive little or no schooling, and education for boys is generally poor.

$500 billion on interest The war has been funded with borrowed money.

To finance war spending, the United States borrowed heavily and will pay more than $600 billion in interest on those loans through 2023. The rest of the debt will take years to repay.

In addition to the more than $2 trillion the American government has already spent on the war, debt and medical costs will continue long into the future.

$1.4 trillion on veterans that have fought in post-9/11 wars by 2059 Medical and disability costs will continue for decades.

More than $350 billion has already gone to medical and disability care for veterans of the wars in Iraq and Afghanistan combined. Experts say that more than half of that spending belongs to the Afghanistan effort.