The killing has prompted President Barack Obama to review security measures while renewing questions about his plans to withdraw almost all U.S. troops by the end of 2016. It also underscores the Afghan army's challenge to stay unified as it takes the lead role in fighting Taliban insurgents who are seeking a return to power once the U.S. leaves.
"This really illustrates that Afghanistan is really not ready for the handover or the transition," Sajjan Gohel, director of international security for the Asia Pacific Foundation in London and a visiting lecturer at NATO's key training facility in Germany, said by phone. "You can train Afghan troops as much as you want and as well as you think you can. If they don't have an idea of national identity or one they can all relate to there will always be problems."
The attack also highlights NATO's challenges in vetting of Afghan troops. Rafiqullah, an ethnic Pashtun, joined the Afghan military in 2011 in the eastern province of Paktia and has been stationed in Kabul the past two years, Wahab said. Rafiqullah's friends told Afghan officials that he wasn't very friendly and avoided social gatherings with fellow troops, Wahab said.
"This person was sometimes critical of foreign forces and considered them in the same way the Taliban did as infidels and occupiers," Wahab said, citing information given by Rafiqullah's friends. Wahab was unclear on the motivation for the attack and said an investigation is underway. Bloomberg News didn't speak to anyone who claimed to know him directly.
The number of U.S-coalition soldiers killed in so-called insider attacks has declined over the past three years. Four international troops were killed by Afghans this year before the latest attack, compared with 16 last year and a record 64 in 2012, the North Atlantic Treaty Organization said in reply to questions by e-mail.
To reduce such attacks, the U.S.-led International Security Assistance Force said they have taken measures including counter-insurgency training, improving cultural awareness and helping Afghans recruit troops and report suspicious activity.
"This attack is not representative of the positive relationship developed between" Afghan and coalition troops, NATO said in an e-mail. "We remain committed to our mission in Afghanistan and will continue to work with our Afghan partners to ensure the safety and security of all coalition service members and civilians."
Pashtuns are the largest ethnic group in Afghanistan and are the dominant ethnic group of the Taliban. They make up 46 percent of the soldiers in the army, according to a 2014 report by the Brookings Institution based in Washington.
Greene's death underscores the continued risk to the 30,600 U.S. forces remaining in Afghanistan, even as troops are withdrawn. As of July 29, 2,338 Americans have died in the war, according to data compiled by Bloomberg.
"These incidents erode the trust between the foreign troops and their Afghan allies, so they can have a chilling effect on that partnership," Graeme Smith, a senior analyst at the International Crisis Group in Kabul, said in an e-mail. "Fortunately the number of these green-on-blue attacks has diminished as the foreign troops withdraw, and they are likely to remain relatively uncommon."
Among the 15 people wounded in this week's attack in Kabul was a German brigadier general, according to the German Defense Ministry in Berlin.
Greene was the highest-ranking U.S. officer to die in combat since Lt. Gen. Timothy Maude was killed in the September 11, 2001, al-Qaida attack on the Pentagon.
Greene was assigned to his post in Afghanistan after serving as the Army's deputy for acquisition and systems management. A Pentagon biography says he was a native of upstate New York who graduated from Rensselaer Polytechnic Institute in 1980 and held two master's degrees in engineering and a Ph.D. in materials science. His decorations include the Legion of Merit with three oak leaf clusters.
With assistance from David Lerman and Tony Capaccio in Washington.