A roadside bombing killed two American soldiers late Friday night near Kabul, part of a violent 24-hour span in Afghanistan that left dozens of people dead.

A US official told NBC News that a bomb detonated on the road near Bagram Airfield, the largest US military base in the country. The Taliban claimed responsibility for the attack on Twitter.

The explosion occurred just hours before one of Afghanistan's top officials was killed on his way to work Saturday morning. Atiqullah Rawoofi, the head of the Supreme Court's secretariat, was shot near his Kabul home in another attack for which the Taliban claimed responsibility, an Afghan police official told the Associated Press.

Meanwhile, in south Kabul, a suicide bomber targeted a bus, killing at least six Afghan soldiers and injuring more than 10 people Saturday.

Every hour, the number of reported casualties from the attack seemed to rise.

Dozens killed in Afghanistan fighting as foreign troops head home — Timothy Large (@timothylarge)December 13, 2014

Video footage shows the brutal aftermath of the bus bombing, which left only a hollowed-out, incinerated shell of the vehicle.

In southern Afghanistan's Helmand province, another attack killed at least 12 people who worked in a landmine removal operation Saturday. It was unclear whether those killed worked as contractors clearing the mines, or whether they were Afghan soldiers. An Afghan military commander told Al Jazeera the people killed were de-miners, but local news sources tweeted a different story.

Afghan Air Force Targeted The Car which was used by assailants on — Mamoon DURRANI (@MamoonDurrani)December 13, 2014

The wave of attacks comes as foreign troops prepare to leave Afghanistan at the end of this year.