President Donald Trump made a bombshell announcement on Saturday, via Twitter, about plans for a secret Camp David meeting with the president of Afghanistan and representatives of the Taliban — only to say he had canceled the talks. It was the latest development in an 18-year-long war waged in Afghanistan between the United States and the Islamic fundamentalist militants. Here is a look at how we got to this point.

Timeline: The Taliban's rise

The Taliban rose to power in Afghanistan in the 1990s amid the fighting among various factions following the collapse of the Moscow-backed government in Kabul. In 1996, the Taliban, a Sunni Islamic fundamentalist group comprised of veterans of the war against the Soviet Union, took the capital. The Taliban ruled under sharia law, enforced by the Ministry of Virtue and Vice, a religious police force.

The Taliban were not officially recognized by most other nations. In 1999, the United Nations Security Council adopted a resolution condemning links between al-Qaeda and the Taliban, who provided the terror group sanctuary for operations.

Soon after the 9/11 terror attacks, on September 18, 2001, President George W. Bush signed a resolution authorizing the use of force against those responsible: al-Qaeda, with the support of the Taliban. Nineteen days later, on October 7, the U.S. launched its first air strikes on Afghanistan after the Taliban refused to hand over al-Qaeda leader Osama bin Laden.

The Taliban government quickly fell as militants abandoned the capital, Kabul. On December 7, 2001, the Taliban stronghold of Kandahar fell, with both bin Laden and Taliban leader Mullah Mohammed Omar escaping. (Bin Laden would later be hunted down by the U.S. and killed in Pakistan; Omar would die of tuberculosis in 2013, his death kept secret for two years.)

Over the course of what has become America's longest war, more than 2,400 U.S. servicemen and women have died in Afghanistan, as have approximately 1,000 NATO and coalition forces. The U.S. has spent more than $2 trillion on the conflict.

But the Taliban, who regrouped in the border region between Afghanistan and Pakistan, had a resurgence in 2006. The group took advantage of weak Afghan government leadership and launched hundreds of attacks each month.

When President Obama took office in 2009, there were 36,000 U.S. troops and 32,000 NATO forces in Afghanistan. The president ordered a troop surge of some 17,000 U.S. troops to handle the increase in violence from extremist attacks. Later that year, Mr. Obama announced additional forces to be deployed.

Afghan security forces officially took over the war in 2014, but thousands of U.S. troops remained to deal with the continuing instability.

Since then, the Taliban has steadily gained more power and more territory. Taliban militants now control more of Afghanistan than at any time since the 2001 U.S. invasion, giving them more leverage, and a crucial seat at the negotiating table.

There are about 14,000 American troops still in the country.

Peace talks, on and off

For nearly a year there have been the nine rounds of U.S.-Taliban talks, with former U.S. Ambassador Zalmay Khalilzad serving as President Trump's Afghanistan envoy.

The Taliban want U.S. and NATO troops out of Afghanistan as quickly as possible, while the U.S. seeks guarantees that the Taliban will not allow the country to become a haven for extremist groups like ISIS.

Just last week, Khalilzad announced that he had come to an agreement "in principle" with the Taliban for the withdrawal of about 5,000 U.S. troops within 135 days of a deal being signed.

Then, on Saturday, President Trump made the surprise announcement that peace talks with the Taliban had been canceled. Mr. Trump tweeted that he "called off peace negotiations" in the wake of last week's car bomb attack near the U.S. embassy in Kabul that killed one American service member and another NATO soldier, as well as at least 10 civilians.

The president further revealed that the meetings with Taliban representatives and the president of Afghanistan would have been held at Camp David, the presidential retreat in Maryland — on the very week marking the 18th anniversary of the 9/11 terror attacks, in which 3,000 Americans died on U.S. soil.

The announcement caught Afghan President Ashraf Ghani's government on the back foot, said CBS News correspondent Charlie D'Agata, reporting from Kabul.

President Ghani had been informed in advance that the Taliban had been invited to Camp David, a senior Afghan government official confirmed to CBS News. The official said the U.S. called off Ghani's visit, and denied that the cancellation was a protest move by the Afghan government.

Also surprised by Mr. Trump's announcement were the Taliban, who warned in a statement that it would lead to a prolonging of an already-long war, and the loss of more American lives.

Mr. Trump's move was criticized by members of both parties. Republican Congressman Adam Kinzinger, of Illinois, tweeted: "Never should leaders of a terrorist organization that hasn't renounced 9/11 and continues in evil be allowed in our great country. NEVER. Full stop."

Congressman Adam Schiff, a Democrat and chairman of the House Intelligence Committee, tweeted: "Negotiations to end America's longest war are not a reality show, and an ill-prepared summit — as with North Korea — was not the answer. Let the diplomats do their work."

"Face the Nation" host Margaret Brennan reports that, according to U.S. and Afghan officials, the reason the Trump administration called off the talks goes deeper than the president's tweet, in which he claimed the Thursday bombing promoted him to cancel. There had been no ceasefire agreed to by either side, and negotiations had been continuing Thursday even after that bombing. Talks had also gone on despite the deaths of 15 other U.S. military personnel since the beginning of the year.

A senior administration official told Brennan that it became apparent that the Taliban negotiators did not have full command and control of those Taliban fighters who'd conducted the attack. In addition, key details of the agreement were still unfinished.

The Taliban publicly have said they would not travel to the U.S. until a deal was signed. There was confusion on this point; on "Face the Nation" Sunday, Secretary of State Mike Pompeo told Brennan the administration did believe the Taliban had accepted its invitation.

There is also the backdrop of disagreement within the Trump administration, particularly between Secretary Pompeo and national security advisor John Bolton, on whether a reduction of U.S. troops could happen with or without a negotiated deal.