Insurgents had killed 19 security personnel in separate assaults in Afghanistan, a day after twin bombings in Kabul killed 21 people, including two local TV reporters.
Another 89 people were wounded in Wednesday's bombings, in a Shiite neighbourhood of the capital.
The attack bore the hallmarks of the Islamic State group, which has carried out a wave of bombings against minority Shiites in recent years. The Taliban denied responsibility. Later Wednesday, suspected Taliban insurgents overran a security outpost in the northern Badghis province and then ambushed reinforcements, killing a total of 10 soldiers, according to Jamshid Shahabi, a spokesman for the governor.
In what is being described as an insider attack, a local police official in the northern Takhar province turned his weapon on his colleagues early Thursday, killing all eight. Abdul Khali Aseir, the provincial police spokesman, says the gunman escaped. Two journalists from Afghanistan's TOLO TV were among those killed in the Kabul bombings. Samim Faramarz and Ramiz Ahmadi were "fearless" reporters who represented what is best in the country, the station said in a posting on Twitter. "They challenged and pushed boundaries to deliver news to millions daily.
We are devastated," it said. The UN envoy to Afghanistan, Tadamichi Yamamoto, condemned the "callous attack" in Kabul and expressed "deep concern over the heavy price paid by Afghan media, with the killing of journalists in Afghanistan being among the highest in the world." In April, nine journalists who rushed to the scene of an explosion in Kabul were killed by a second suicide bomber. A 10th journalist was killed the same day, shot in eastern Khost province.
Both the Taliban and IS carry out near-daily attacks in Afghanistan targeting security forces and government officials but IS also regularly targets Shiites, who it views as apostates. In the same neighborhood where the twin bombings took place, an Islamic State suicide bomber killed 35 high school graduates last month as they sat for their university entrance exams. The dead were all teenagers.