A Taliban suicide bomber struck outside Afghanistan's Supreme Court on Tuesday, killing 17 people in the deadliest attack in Kabul in over a year and a half.

It was also the second consecutive day of attacks in the Afghan capital, undermining the ability of Afghan forces to keep security without help from NATO troops.

The attacker rammed his SUV into buses carrying court employees at the end of the day' work. All of the dead were civilians, including women and children, police said, and at least 39 people were wounded.

The Taliban said they delivered a blow to "cruel judges" who obey Western powers, and warned of more bombings to come.

President Hamid Karzai condemned the attack, saying it was another "terrorist act that once again shows the Taliban are serving the enemies of Islam."

Tuesday's attack was the deadliest in Kabul since Dec. 6, 2011, when a suicide bomber on foot hit worshippers at a Shiite shrine, killing at least 80 people.

It came just a day after heavily armed fighters launched a failed assault on NATO's operational headquarters at the military section of Kabul's international airport. All seven attackers were killed by Afghan forces and only two civilians were wounded in Monday's attack.

Hitting such high-profile targets as the Supreme Court or the international airport stirs up fear and threatens to shake confidence in Karzai's government. The courthouse is on a busy main road in central Kabul, near the U.S. Embassy. The NATO headquarters is also nearby.

Tuesday's blast went off as court employees were leaving the building from the back entrance, mostly in buses or private cars, said police officer Jahn Agha. Police spokesman Hashmat Stanikzai said the bomber specifically targeted the buses with court workers.

Taliban spokesman Zabiullah Mujahid claimed responsibility for the attack.

"The Islamic Emirate of Afghanistan was obligated to act against this puppet regime because the people have suffered under the courts," said Mujahid, referring to the Taliban by the name they were known when they ruled Afghanistan. He warned of more such attacks if courts did not stop jailing insurgents.

As international forces started a withdrawal that will see most foreign troops gone by the end of 2014, the Taliban and other groups have unleashed a wave of bombings and assassinations around the country, testing the ability of Afghan security forces to respond with reduced help from NATO troops.

The Taliban have said they would go after government workers as part of their spring campaign targeting those serving in Karzai's administration.

Despite an enormous security cordon around the capital, Kabul remains a prime target for insurgents.

On May 16, a suicide car bomber killed six Americans in a U.S. military convoy. Earlier that same day, heavily armed fighters attacked the compound of an international aid group in an upscale neighborhood, kicking off an eight-hour battle that killed two civilians and a police officer before all the militants were killed.

Authorities have said that Afghan forces have been able to fend off major attacks and have foiled several other plots, but the insurgents' ability to strike Kabul has raised questions of whether violence will continue to soar.

Earlier Tuesday, the U.N. in Afghanistan expressed concern over what the mission said was a surge in civilian casualties in the first six months of the year.

Jan Kubis, the U.N. special representative to Afghanistan, said 3,092 civilians were killed or wounded from January to June -- a 24 percent increase, compared to the same period last year.

Though Kubis didn't provide a breakdown for the dead and wounded, he blamed the insurgency for the casualties, saying it was trying to take advantage of the drawdown of foreign troops.

"Because of their campaign, civilian casualties have increased and the situation has worsened," he said.

Kubis said insurgents were behind 74 percent of all civilians casualties in the first six months of 2013, and attributed the rise on the militants' "continuing disregard" for international laws on civilians in conflict. He said pro-government forces were to blame for 9 percent of the casualties, but did not say who was responsible for the rest.

Kubis also said that targeting government officials and civilians was a crime under international law. The Taliban have argued that government officials and workers are legitimate targets.

The U.N. in Afghanistan had publicly and privately sent a message to the Taliban that the mission was "willing to discuss civilian casualties and how to reduce them," he said.

The Taliban in return sent "signals of their willingness to discuss this," Kubis added, though a way to establish contact with the group has not yet been worked out.

Kubis also voiced concerns over the targeting of humanitarian groups, citing two attacks in May, one on the international Red Cross in eastern Afghanistan and the other on the offices of the U.N.-affiliated International Organization for Migration in Kabul.

Also Tuesday, two police officers and two truck drivers were killed when insurgents attacked a convoy carrying cargo through the eastern province of Ghazni. Deputy police chief Asadullah Insafi said three insurgents were also killed in the attack.