The interior ministry said overall 35 people were injured.
The attacks come in the week the new US envoy for Pakistan and Afghanistan, Richard Holbrooke, is expected to visit Kabul.
The international forces in Afghanistan condemned the attacks as "callous and indiscriminate".
Taleban warning
Five gunmen attacked the justice ministry at 1005 (0535 GMT), Interior Minister Hanif Atmar said.
He said the attackers killed 10 staff members, two intelligence workers and a policeman.
The five gunmen were all killed in a three-hour operation he said.
Mr Atmar said that almost simultaneously two suicide attackers targeted the Prisoner Affairs Department in the north of the city.
Six policemen were killed there and 29 people wounded, the minister said.
He added: "At 1003 our ministry of education was attacked by a terrorist suicide attacker who was armed with weapons and suicide vests.
"He was identified by our security forces and gunned down before achieving his goal."
At one point the justice minister was locked inside his office under armed protection.
There was constant gunfire there as police scaled the building with ladders to enter through windows.
Student Assadullah Jagdalak was inside the justice ministry and said he hid under a table when he heard shooting outside the building.
"Security guards started shooting and then the attackers responded by killing other security guards. One got inside the building and started shooting, one guy got upstairs," he said.
DEADLY KABUL ATTACKS
Jan 09: Suicide bomber kills five outside German embassy
Oct 08: Suicide attacker kills five inside culture ministry
Jul 08: Suicide car bomber kills more than 50 at Indian embassy (above)
Apr 08: Failed assassination attempt on President Karzai leaves six dead
Feb 07: Attack on US Bagram base leaves 24 dead
Sep 06: Sixteen killed in suicide attack near US embassy
Sep 02: Car bomb leaves 30 dead
Salim Hayran, who works at the education ministry, told the BBC: "After I heard the firing I could see from my window people running and the security guards everywhere."
The commander of Nato's International Security Assistance Force, Gen David McKiernan, condemned the attacks.
"Once again the Taleban have displayed that they have no respect for Afghan citizens or any desire to see a peaceful future in Afghanistan," he said.
The BBC's Ian Pannell in Kabul says there had been a warning that the Taleban were planning a high-profile attack.
He says the attack follows a number of similar assaults last year and comes at a time when President Hamid Karzai is offering to sit down and start peace talks with the Taleban.
The incident comes after US military chief Adm Mike Mullen said more American troops were needed urgently in Afghanistan.
US President Barack Obama is expected to announce soon how many extra US troops could be sent to Afghanistan, and has called for Nato reinforcements.
Mr Holbrooke is expected in Kabul later this week, after his visit to Pakistan.
Before he left for the region, he said Afghanistan would be "much tougher" to solve than Iraq and that he had "never seen anything like the mess we have inherited".
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.
Bookmark with:
What are these?