Guards shot at protestors who had carried the coffin of a young girl to the Afghan president’s palace after she was found beheaded on Saturday.
The girl was one of seven Hazaras – a minority group of Persian-speaking Shia Muslims – whose bodies were discovered in the country’s south-eastern Zabul province. It is believed that the group was taken hostage by militants about a month ago.
No one has claimed responsibility for the killings, but Afghan officials have blamed extremists ranging from the Taliban to Isis.
It is understood rival Taliban groups had been fighting each other in the area where the bodies of the four men, two women and a nine-year-old girl were found in the last five days.
Female protestors carried the coffin of the youngest victim, named Shukira, through Kabul draped in a green flag representing Shia Muslims.
The thousands marching called on President Ashraf Ghani to step up security in the country or to resign.
Presidential guards opened fire at some of the protestors who tried to scale the walls, wounding 10 people, according to the president’s deputy spokesman.
Sakhi Rizayee, one of the organisers of the protest, said: “We came to the front gate of palace to raise our voices for justice and to condemn all acts of murder in the country.”
Another activist, Zahra Sepehr, added: “We want justice and we want this government, Ghani and Abdullah, to go so that we can have a government that protects all the people of the country and brings security to the whole country.”
The protestors walked for almost four hours with the coffins before reaching the president’s palace at Pashtunistan Square.
The seven coffins were moved inside the grounds of the palace, where they stayed overnight.
In a televised appeal for calm, Mr Ghani later said: “The nation’s pain is my pain. Like you, I will not calm down until the perpetrators of these crimes are brought to justice.
“We shall revenge the blood of our brothers and sisters.”
He said the authorities would show “no mercy” to the killers and that “enemies of Afghanistan” were trying to create disunity and “bring ethnic and sectarian violence” to the country.
The United Nations Assistance Mission in Afghanistan condemned the killings, saying they may have amounted to a war crime.
Additional reporting by the Associated Press