The U.S. war in the ‘graveyard of empires' has lasted nearly 17 years. Will it ever end? Here's everything you need to know:

What's the country like now?
Afghanistan has changed a great deal since the U.S.-led coalition first invaded in December 2001 to topple a Taliban government that had given safe haven to al Qaeda leader Osama bin Laden. The population of Kabul has shot up from 1.5 million then to almost 6 million now, and that's bad news for the Taliban, because cosmopolitan urbanites are much less likely than rural peasants to submit to the Taliban's harsh form of Sunni Islam. Women, ruthlessly oppressed under the Taliban, are now freer, at least in Kabul. Still, the war is everywhere, and the Taliban are on the offensive. The government controls the cities and about 60 percent of the country overall. The rest is either contested or under Taliban control — which means the Taliban now rule more territory than they have at any time since 2001. And the Taliban have stepped up attacks this year, possibly in preparation for talks, so they can negotiate from strength. Just last month, the Taliban laid siege to the southeastern city of Ghazni for days, killing hundreds of Afghan soldiers and civilians.

How many U.S. troops are there?
When President Obama took office, there were 30,000 U.S. troops. His surge more than tripled the force, to more than 100,000 at its peak in 2011, in the hope that a decisive blow would bring victory. But the Tal­i­ban knew Obama intended to withdraw the troops soon, and waited him out in safe havens in Pa­ki­stan. Pres­i­dent Trump entered office deeply skeptical of the war, but the military persuaded him to continue supporting the Afghan army. Reluctantly, Trump boosted forces from 8,400 when he took office to nearly 15,000 now, on an open-ended mission, and he eased restrictions on the use of armed drones and airstrikes. "We will fight to win," Trump pledged last year. But 15,000 U.S. troops can't defeat the Taliban; they're fighting merely to keep the Afghan forces from collapsing. Those Afghan forces number about 300,000, at varying levels of training, but there is frequent desertion, and they suffer heavy losses: In 2016, nearly 7,000 soldiers and police were killed — and then the government stopped releasing figures.

What about the Taliban?
The Taliban are believed to number from 20,000 to 40,000 fierce and committed fighters — about the same as a decade ago, even though Afghan forces regularly report killing more than 1,000 a month. And the Taliban are rich, with an annual budget of an estimated $2 billion. They get foreign funding from Pa­ki­stani intelligence, Qatar, Saudi sources, and probably Russia; local funding comes from their control of the lucrative international opium and hashish trades, which employ nearly 600,000 Afghans. "If we compare the anti-government forces with Afghan security forces, the Taliban are better equipped, have more resources, and have access to modern weapons," a Logar Province councilman, Abdul Wali, told The New York Times. Faced with the impossibility of military victory, the Pentagon's goal has changed. "We are going to drive this to a negotiated settlement," Defense Secretary James Mattis recently said. Up to now, however, the Taliban have never negotiated in good faith, and have rejected the terms the U.S. has set for peace: They must renounce violence, break ties with al Qaeda, accept the protections of women's rights in the Afghan constitution, and negotiate directly with the Afghan government.

Why can't the U.S. just pull out?
Because the government would surely fall. Afghanistan would once again become a Taliban-ruled medieval society, and al Qaeda and ISIS would have free rein there to plan and carry out attacks on the U.S. The Pentagon remembers all too well that in 2011, when the U.S. pulled out of Iraq, it led to civil war and the rise of ISIS. Most experts in the region believe that negotiating with the Taliban is the only way to end the conflict — but that such negotiations must involve pressure and input from powerful neighbors, including India, China, Russia, Iran, and most of all, Pakistan.

Why is Pakistan so important?
To date, Pakistan has played a double game. The U.S. relies on Pakistani land and airspace to supply its troops, yet the Pakistani military also allows the Afghan Tal­i­ban to retreat into its territory. That's why Pakistan's new prime minister, Imran Khan, sworn in two weeks ago, could be a game changer. Khan, an ethnic Pashtun like most Taliban, is a fierce critic of the U.S. occupation of Afghanistan and has long advocated for negotiating with the Pakistani Taliban, earning him the nickname "Taliban Khan." But he has said Pakistan needs a stable Afghanistan, and the U.S. hopes Khan can nudge the Taliban to the table. "Cooperation from Pakistan remains key," said U.S. Central Command chief Gen. Joseph Votel last month. "Now is the time for them to step forward."

An exorbitant cost
Nearly 2,400 U.S. service personnel have been killed in the Afghan war, and more than 20,000 wounded, many severely. The cost in treasure is staggering. Most estimates put it at around $4 trillion so far, but if you add in the future costs of the war veterans and their health care, as well as the interest on the money borrowed to finance the war, the figure approaches $8 trillion. Much of this money was wasted through corruption and mismanagement. John F. Sopko, the special inspector general for Afghanistan reconstruction, told a Senate committee this year that "the United States threw itself into reconstruction with haste and hubris, with untested assumptions and unrealistic expectations, and with piles of cash and tight deadlines for spending it — too much, too fast, with too little oversight." By 2014, $109 billion had been spent on reconstruction alone — more in today's dollars than the entire Marshall Plan that rebuilt Europe — yet Afghanistan still lacks adequate roads, schools, and infrastructure. Opium remains the largest cash crop. The U.S. still spends $45 billion a year on Afghan security and economic aid — more than double Afghanistan's GDP.