The nine were working with the Afghan National Solidarity Program, according to Abdul Razaq Qaderi, chief of the criminal department for Balkh province.
A Czech humanitarian organization, People in Need, said it employed the workers, who were Afghan nationals. They were attacked at a field office in the Zari district of Balkh, it said.
A statement on the organization's website
offered condolences to the workers' families and condemned an attack "unprecedented in its brutality."
The investigation is ongoing, People in Need said.
"The identity of the attackers is not known, but according to available information they did not originate from the area, where PIN has been working since 2002," it said.
"PIN immediately suspends all work in Afghanistan and is adopting measures to strengthen the security of its employees in the country."
Afghan President Ashraf Ghani condemned the attack, calling those responsible "enemies of progress and development in Afghanistan." The attackers killed innocent workers who were helping those in need, he said in a statement from his office.
A team has been sent to the area to investigate, Qaderi said. He did not say who the armed militants were.
The Afghan government created the National Solidarity Program in 2003 to "develop the ability of Afghan communities to identify, plan, manage and monitor their own development projects," according to the agency's website.
Mark Bowden, humanitarian coordinator for the U.N Office for the Coordination of Humanitarian Affairs in Kabul, said the attack highlighted the challenges aid workers face in Afghanistan and the "unacceptable sacrifices" they are making.
"Since the start of 2015, 26 aid workers have been killed, with another 17 injured and 40 abducted," he said in a statement.
"Aid workers in Afghanistan provide emergency trauma care, run feeding (programs) for malnourished children, and assist people displaced from conflict and natural disasters. Attacks against aid workers lessen their ability to carry out these essential activities, leaving the most vulnerable in Afghanistan most at risk."