Security forces in Afghanistan rushed to the scene of three Taleban attacks on government buildings in the capital, Kabul, which officials say killed at least 27 people and injured more than 50.
There was constant gunfire as police scaled the justice ministry with ladders to enter through windows.
At one point the justice minister was locked inside his office under armed protection. He told the BBC he was safe but was unable to leave. Four militants who attacked the building were killed.
As gunfire reverberated throughout the city, members of the public and ministry workers ran for cover.
Frightened children were escorted away from the ministry of justice.
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.
After the violence subsided, three suicide bombers and four gunmen had been killed and several police officers were dead or injured, officials said.
The attacks come in the week the new US envoy for Pakistan and Afghanistan, Richard Holbrooke, is expected to visit Kabul.
Security remains heavy. The Taleban have said they carried out the attacks in response to the treatment of Taleban prisoners in Afghan jails.