The attacks in a city dense with barricades and armed guards underscored the difficulty of fending off the Taliban even with abundant troops and weaponry as the U.S. beefs up its presence.
The eight assailants sent three text messages to the leader of their terror cell in Pakistan before launching Wednesday's assault, said Amrullah Saleh, chief of Afghanistan's intelligence agency, underlining the links between militants in the two countries.
Five men armed with assault rifles and grenades attacked the Justice Ministry in late morning, shooting at workers and temporarily trapping the minister and scores of others inside, witnesses said.
Minutes after the gunmen stormed the ministry, hundreds of Afghan and international security forces rushed to the scene and cordoned off the area, reported CBS News' Fazul Rahim. A fierce exchange of fire then broke out between the gunmen and security forces, which lasted several hours.
Saleh said that security forces confiscated six AK-47s, two pistols, six mobile phones, eight grenades, one suicide vest and hundreds of AK-47 rounds, reported Rahim. He added that all the terrorists appeared to be 20-25 years old.
Mohammad Asghar, who escaped the Ministry building by jumping out of a second floor window, told CBS News: "I heard a big explosion in the building and minutes later two gunmen in military uniforms walked in to our office and started shooting at everybody. I ran through a window to the next room and jumped down. I saw the bodies of six of my coworkers in the room."
At about the same time, two men in suicide vests blew themselves up at the ministry's correction department across town. A third assailant in a suicide vest was shot as he tried to force his way into the Education Ministry, about a half-mile from the Justice Ministry attack, said Defense Ministry spokesman Gen. Mohammad Zahir Azimi.
At least 20 people were killed in the attacks and 57 wounded, said Mohammad Hanif Atmar, the interior minister. All eight attackers died, Azimi said, bringing the total death toll to 28.
Dr. Abdullah Fahim, a spokesman for the Public Health Ministry, told CBS News that many of the wounded were in critical condition.
Zabiullah Mujaheed, a spokesman for the Taliban, said the attacks were in response to the alleged mistreatment of Taliban prisoners in Afghan government jails.
"We have warned the Afghan government to stop torturing our prisoners," Mujaheed told AP in a phone call from an undisclosed location. "Today we attacked Justice Ministry compounds."
A Taliban commander named Qari Talah, who claims his group is operating inside Kabul, told CBS News' Sami Yousafzai Wednesday via telephone, "seven brave members attacked in many places in Kabul and it was revenge for the indiscriminate killing of the Taliban prisoners in Kabul prison last month."
Talha said he was in command of 60 militants in central Kabul and that his brigade was planning a more "stunning attack." He claimed his militants were "now easily operating in Kabul, and our influence and control reach to the suburbs."
He warned residents not to visit government offices.
The Taliban regularly use suicide bombings in their assaults on Afghan and foreign troops, but the capital had been largely spared of major attacks recently.
Saleh, the intelligence chief, said officials had intelligence indicating a "spectacular" attack involving multiple suicide bombers was imminent, but said they did not have enough specifics to prevent it.
He compared Wednesday's attacks to the assault on hotels, markets and a train station in Mumbai last November that killed 164 in India. Indian officials have blamed the Mumbai attack on the Pakistani-based militant group Lashkar-e-Taiba. Saleh did not offer any more specifics.
Twenty-one suspects were detained, he said.
The attack comes as Richard Holbrooke, President Barack Obama's newly appointed envoy to the region, is expected imminently in Afghanistan from neighboring Pakistan. Mr. Obama has vowed to increase U.S. focus on the resurgent Taliban, including sending more troops and designating Holbrooke, who is helping the administration chart a new strategy to beat the insurgencies raging in both countries.
The Taliban regularly use suicide bombings in their assaults on Afghan and foreign troops, but attackers have rarely made it inside the barricaded and guarded compounds of government buildings in the capital.
Justice Minister Sarwar Danesh spoke to the AP while he was briefly trapped inside the ministry with a number of government employees.
"They used grenades and AK-47s," Danesh said of the attackers, speaking by mobile phone.
A ministry worker said he scrambled out of a second-floor window to escape an advancing gunman.
"I came out of my office to see what was going on, and I saw a man with an AK-47 shooting at every employee he saw in the hall," said ministry employee Nazir Mohammad, shaking as he spoke.
Wednesday's attack follows on an assault last month, when a Taliban suicide bomber attacked vehicles on a road that runs by both the German Embassy and a U.S. military base. One U.S. service member and four Afghan civilians died.
Elsewhere, in Logar, one province south of Kabul, a roadside bomb exploded near a French military medical team's convoy, killing one French officer and two Afghans, said Den Mohammad Durwesh, the governor's spokesman. The French government said another soldier was seriously injured.
Also in Logar, a helicopter with the U.S.-backed coalition killed five civilians as it responded to ground fire, Durwesh said. U.S. spokesmen could not immediately be reached for comment.