Afghanistan is the only country in the world where American soldiers are still dying. American Major General Harold Greene was killed last week in Kabul and two enlisted men died in Kandahar the week before.

The killer in Kabul sprayed a group of NATO commanders with bullets at a British-run training facility. Fourteen others were wounded in the attack, including more Americans, some critically.

In July, the U.N. Mission in Afghanistan announced in its annual mid-year report that more than twice as many women and children had already been killed in 2014 than the previous year -- the most since the U.N. began keeping records in 2009.

"The nature of the conflict in Afghanistan is changing," said Jan Kubris, a U.N. special representative. "The impact on civilians is proving to be devastating."

Get Breaking News Delivered to Your Inbox

Since the U.S. invaded Afghanistan in October 2001, fighting has spread in civilian areas. More civilians are dying from ground combat than from IEDs, suicide bombs or airstrikes.

On July 25 -- the day Muslims around the world marked Eid al-Fitr, the festival at the end of the holy month of Ramadan -- the Taliban's elusive leader Mullah Mohammed Omar issued a statement touting the strength of his organization and calling on Afghans to "join the ranks of the Taliban."

He called on policemen and soldiers to "come and wage jihad alongside your own people." The killer in Kabul, and a policeman who shot six of his fellow officers to death at a checkpoint in southern Afghanistan on Aug. 6, likely heard the Mullah's call.

The centuries-old social fabric of Afghanistan, where tribes ruled the countryside, protected their people, and where a man's plot of land was safe, "is destroyed," a senior Afghan official lamented to CBS News last week.

"The Americans do not know how to fight a guerrilla war," said the official, who spoke to CBS News on condition of anonymity. "They came in with all their military might and their technology and thought, 'How can these people exist against us?' Now, as they leave, it is the rule of the gun."

Secretary of State John Kerry flew back into Kabul last week to stop a figurative and literal fist fight. His shuttle diplomacy has seemingly salvaged the Afghan presidential elections -- the cornerstone of America's effort to introduce democracy in the country.

The presidential elections held in April were to pick a replacement for President Hamid Karzai, a member of Afghanistan's Pashtun ethnic group.

Pashtuns are the majority in Afghanistan. The Taliban are Pashtuns.

Abdullah Abdullah, a candidate with a Tajik heritage, won the most votes. His slightly unclear lineage and his decades-long alliance with the ethnic Tajik and Uzbek "Northern Alliance" mean he has not carried the Pashtun vote. Ashraf Ghani Ahmadzai, whose heritage is 100 percent Pashtun, came second.

While Abdullah won the most votes, he failed to win a clear majority. In keeping with the constitution, a runoff election was held. Ahmadzai won a majority this time; a complete reversal.

But Abdullah's people cried foul, producing evidence they said, that ballot boxes were stuffed and that officials linked to the current administration were complicit in widespread fraud.

Abdullah refused to back down and there was fear of a coup.

With America's long project in democracy in clear jeopardy, Kerry flew to Kabul on July 12 and convinced both sides to agree to a recount of the ballots.

Last week, as the vote recount continued, Abdullah and Ahmadzai supporters got into a fist-fight as they argued over the legitimacy of individual ballots. The nation's ethnic divisions were on display.

On Friday, after Kerry spent 24 hours cajoling the warring candidates to strike a deal, he was able to stand shoulder to shoulder with both men to announce a breakthrough. Abdullah and Ahmadzai agreed to form a national unity government to stop the feud, calling it an Afghan-owned process, supported by the U.S. and the United Nations.

Kerry said both candidates had agreed to stay out of the ongoing audit process -- and to respect its outcome.

It was cause for optimism; a sign that reason might prevail over violence. But Afghanistan and its U.S. backers have been down this road before.

After American forces toppled the Taliban leadership in 2001 and forced its al Qaeda allies underground in Afghanistan, officials in Washington didn't know their war was just beginning.

Several years later, to Western minds, the war was winding down. In October 2004, President Karzai won the first true election in Afghan history after city dwellers and villagers ignored Taliban threats and lined up in the rain and mountain snow to vote.

But gradually the Taliban, whose leadership had retreated to Pakistan, came back.

The war was then and is today being fought largely in Pashtun areas, where many are still sympathetic to the Taliban.

CBS News' Sami Yousafzai has covered the Taliban for decades, and says the militants are "in a better position than they have ever been in 13 years."

Current Taliban commanders and former regional officials from the Taliban regime tell Yousafzai that with the withdrawal of U.S. forces imminent, the writing is on the wall.

"The drawdown of the U.S. and NATO forces has already changed the situation in favor of Taliban and it has given breath to the Taliban to come back," Mullah Salam Akhond, a commander for the group in the southern Helmand province.

"The Afghan army does resist, but they are incapable of coping," Akhond told CBS News in a phone interview.

Another senior Taliban member, a former deputy government minister under the pre-2001 regime, boldly predicted that the group, which just a few years ago could only "dream" of reestablishing itself as a serious power in the country, was "eventually going to establish an Islamic state in Afghanistan."

The ex-deputy minister, who is still powerful figure in the group in eastern Afghanistan, told Yousafzai the Taliban was quite pleased with the national election process for exacerbating the ethnic divide in the nation -- reinforcing the divide between the majority Pashtuns and everyone else.

Taliban members are prone to great exaggeration of both their battlefield victories and aspirations, but former Afghan diplomat and political analyst Ahmad Saedi told CBS News the election crisis and the U.S. drawdown both fuel a Taliban resurgence, and have given the group "tonic to fight back."

He said the Afghan government is clearly weakened and lacks a clear strategy to fight the war the U.S. is preparing to leave.

"Even the Afghan Defense Ministry and Afghan intelligence have no single agenda or strategy to fight the Taliban," warned Saedi.