Security forces fired bullets into the air, evidently trying to disperse protesters trying to breach the palace gates, video broadcast in Afghanistan showed.
At least seven people, including two girls, have been injured, an Afghan Health Ministry spokesman said. The girls were stepped on and are not seriously injured, but men were injured by stray bullets as a result of warning shots, said Ismail Kawoosi, the ministry spokesman.
Most of the thousands of demonstrators were peaceful as they criticized what they see as the government's failure to protect the public. The marchers want to speak to President Ashraf Ghani
about the situation, blogger and protest organizer Mortaza Moshrafi told CNN.
In a speech on national television and on Twitter, Ghani called for unity.
"They are deliberately attempting such evil actions to create division among our people," he said of the ISIS militants. "We should not forget that we can take revenge and bring the culprits to justice only with our unity."
The protesters represent many parts of Afghan society, though the spark that set them off related to the killings of seven members of one ethnic minority -- the Hazaras -- several days ago in Zabul province.
The slain Hazaras, who are Muslims of Mongol descent, were among those kidnapped since last March, when 31 were taken along a highway between Kabul and Kandahar, said Zulfiqar Omid, a political party leader who represents the victims' families. Omid said at least 53 Hazaras have been abducted, and some were released, some killed, while the rest are still captive.
The National Directorate of Security, Afghanistan's intelligence agency, said Tuesday that eight Hazaras -- five men, two women and a teenager -- had been rescued in Ghazni province, which neighbors Zabul.
Still, some feel the Afghan government hasn't done enough. That's why the bodies were taken first to the governor's office in Ghazni, the province where the victims were from, and then to the Afghan capital.
"We (brought) the bodies to the presidential palace in Kabul to demonstrate our anger," Omid said.
Afghan President: ISIS is 'trying to create division'
The United Nations office in Afghanistan said the slain civilians -- two men, two women, two boys and a girl -- had been abducted last month and were beheaded between Friday and Sunday. At the time, clashes were going on in Zabul province, which is in southern Afghanistan not far from Kandahar, between two rival anti-government groups.
"The deliberate murder of civilian hostages, including women and children, is particularly abhorrent," said Nicholas Haysom, the top United Nations official in Afghanistan. "These senseless murders may amount to war crimes, and the perpetrators must be held accountable."
In his speech, President Ghani said the militants have been unsuccessful in their attempts to "take over some parts of our country so that they can turn them into a barbaric and horror nest."
"They tried to spread insecurity and fighting in different corners of the country, but now that they are sure that they have been defeated, they are trying to create division and dissension among the tribes and ethnicities in Afghanistan," he said.
"The President said that the heartless killing of innocent individuals, especially women and children, has no justification in any religion or creed," Ghani's office said. "And the enemies of Afghanistan gain nothing but shame in this world and wrath in the hereafter."
ISIS' emergence is another major worry in a volatile country that has been wracked by years of war. Much of that violence has involved the Taliban
, though al Qaeda -- which, led by the late Osama bin Laden
, called Afghanistan home before the September 11, 2001, terrorist attacks
-- continues to be a threat.
While it first gained a foothold in Syria and Iraq, ISIS
has also been growing in Afghanistan, with the head of U.S. forces in that country saying
it has between 1,000 and 3,000 active members in the Asian nation.
"In the last year, we have observed the movement's increased recruiting efforts and growing operational capacity," Gen. John Campbell told the U.S. Congress last month, saying that many disaffected Taliban have recast themselves as ISIS. "...This rebranding is most likely an attempt to attract media attention, solicit greater resources, and further increase recruitment."