KABUL — Suspected Taliban gunmen ambushed Afghan guards who were in a vehicle headed to work at the US-run Bagram air base, killing at least eight people as part of a surge of attacks by militants around the country, officials said Tuesday.

A Taliban spokesman, Zabiullah Mujahid, said the group carried out the late Monday assault and described the victims as spies for the US military.

Attacks by the Taliban and its Islamic State rivals have been rising in Afghanistan as the United States completes plans to send several thousand more troops to bolster Afghan forces and the 8,500 US troops already in the country.


‘‘We cannot rule out anything — enemy attack, local or tribal hostility,’’ police chief Mohammad Zaman Mamozai said by phone in reference to the attack on the Bagram guards. He said two other occupants of the vehicle suffered bullet wounds.

Meanwhile, violence flared in a series of attacks around the country and in the capital, Kabul, between security forces and protesters who had occupied a busy avenue for the past three weeks.

Videos of the Kabul clashes posted on social media showed a number of wounded men on the street late Monday as well as the body of a man. Protesters contend the man was shot by police. Security officials and the government spokesmen were unavailable for comment.

A protest organizer, Ramish Noori, said several people were arrested.

Afghanistan’s chief executive, Abdullah Abdullah, confirmed on live TV that one protester had been killed and six others wounded. He called for an investigation into the clash.

‘‘Last night’s event in Kabul has shocked all of us,’’ he said.

Protesters have expressed frustration with US-backed President Ashraf Ghani and his inability to stem the rising tide of violence, including a devastating truck bomb on May 31 in Kabul that killed 150 people.


After police opened fire on an antigovernment protest three weeks ago, protesters set up tents and vowed to remain until the president resigned.

Afghanistan’s Independent Human Rights Commission denounced the ‘‘illegal’’ actions by security forces, raising worries about increased ‘‘intimidation and fear.’’

‘‘Tonight’s move against the protesters . . . is not acceptable and the government is responsible for any legal and humanitarian violation,’’ Fawzia Koofi, a lawmaker, said in a message.

Omar Ahmad Parwani, an organizer of the protest, called for massive antigovernment marches and blocking key roads in the capital.