Afghanistan's intelligence service said Wednesday it had arrested two men, including one employed by a foreign aid agency, for planning an attack on a Kabul hotel that left 14 people dead last month.
The National Directorate of Security said in a statement that the men were working for the Haqqani network, a Taliban-allied group based in Pakistan, when they were apprehended earlier this week in Kabul.
One of the men, identified by the agency as Abdul Wakil, was working in the Kabul headquarters of the Paris-based aid agency Madera, which has been active in Afghanistan since 1988.
Although attacks by Afghan soldiers against national and foreign security forces have taken place frequently in recent years, aid workers attacking humanitarian colleagues has been rare.
In a video confession the agency released on its Facebook page, Wakil and an associate, Ghulam Aziz, said they were operating under supervision of Qari Abdullah, a Peshawar, Pakistan-based commander of the Haqqani network.
The two men said they helped the lone gunman in the attack gain access to the Park Palace Hotel and Guesthouse in Kabul.
Aziz, originally from the eastern province of Maidan Wardak, provided a blueprint of the hotel to the Peshawar-based planners, intelligence officials said.
Officials with knowledge of the investigation said that the gunman, whom they identified as Edris, had been staying at the Park Palace as a guest in the days before the attack. The officials spoke on condition of anonymity to discuss intelligence matters.
Seven Afghan and foreign aid workers were among those shot to death in the attack that was claimed by Taliban insurgents and drew international outrage.
Despite the confessions, one official said investigators had still not determined how one gunman armed with a single pistol was able to carry out the attack and remain inside the guesthouse compound for several hours even after Afghan security forces had poured into the area.
"He finished off one round of 16 bullets before reloading, but again, how did someone in a hotel full of dozens of guests manage to reload without being apprehended or shot?" the official said.
The gunman was eventually shot to death by security forces.
In a statement after the attack, the Taliban said it targeted the hotel, which is frequented by international aid workers, because it believes "every foreigner from an invading country, especially NATO," is considered an enemy. Yet the attack may have missed bigger targets, because the Turkish and Indian ambassadors were expected to attend a concert at the hotel that evening, officials said.
"There was a sense that we narrowly dodged a diplomatic nightmare," the official said.
The attack, which came shortly after preliminary discussions began between Afghan officials and Taliban representatives in Qatar, dealt a setback to efforts by President Ashraf Ghani to negotiate a settlement to end fighting -- and undermined the Taliban's own claims about who it is fighting.
Qayyum Kochai, an Afghan official who attended the talks, said Taliban envoys insisted that "bandits" and organized crime groups were committing attacks for which insurgents were being blamed. The envoys said the Taliban's only enemies were the "foreign occupiers" and the government of Afghanistan.
Abdul Wakil's reported involvement with Madera is likely to once again ignite discussions about the risks for aid agencies operating in Afghanistan.
According to the Agency Coordinating Body for Afghan Relief and Development, an Afghan group that advocates for aid organizations, the first six months of 2015 saw 26 aid workers killed, 17 wounded and 40 abducted.
Earlier this week, nine workers of the Czech-based nongovernmental agency People in Need were killed in an attack in the northern province of Balkh, the most lethal attack on an aid organization this year.
In April 2014, medical workers in Kabul were shocked when five foreign colleagues were shot, three fatally, by a guard at a hospital run by the charity group Cure International.