A suicide bomber in Kabul killed at least 16 people and wounded more than 40 others outside the Supreme Court on Tuesday.
Police said a car packed with explosives was driven at buses that were carrying court staff, including judges.
In a statement sent to the BBC, the Taliban said it carried out the attack, saying it had killed judges who "obey Western powers".
The explosion happened at the height of the evening rush hour.
It was the second big attack in Kabul carried out by the group in two days.
On Monday, seven insurgents, including suicide bombers, laid siege to the main airport for four hours before they were killed.
The Supreme Court building is a few hundred metres from the entrance to the US Embassy. NATO's headquarters are also nearby.
The BBC said the attack underlines the Taliban's readiness to target civilians, particularly court officials, whom they consider an arm of the government of President Hamid Karzai.