Heart: Taliban militants stormed an Afghan court on Wednesday, killing at least 44 people in a bid to free insurgents standing trial, officials said, in the deadliest attack for more than a year.

It was not immediately clear whether the accused men had escaped the court complex in the western town of Farah, although a hospital doctor said one prisoner was among those being treated for injuries.

The multiple bomb and gun assault will raise further questions about the Afghans' ability to secure the country as NATO winds down its combat mission in the war-torn country by the end of next year.

"I can confirm that 34 civilians, six army and four policemen have been killed and 91 people, the majority of them civilians, have been injured," Najib Danish, interior ministry deputy spokesman, told.

"Nine attackers have also been killed." The death toll was the highest in Afghanistan from a single attack since a Shiite Muslim shrine was bombed in Kabul in December 2011, killing 80 people.

"The attack is over, but the casualties have unfortunately risen," Farah provincial governor Mohammad Akram Khpalwak told, putting the final death toll as high as 46.

"In total, 34 civilians and 12 (Afghan) security forces have been killed in the attack. We have also discovered the bodies of eight attackers, more than 100 people have also been injured."

The governor added a group of Taliban had been brought for trial on Wednesday, without giving further details.

Taliban militants fighting the US-backed central government claimed responsibility. "Our fighters attacked several government buildings in Farah according to their planned tactic. They conducted the attack with small arms and grenades," the group said on its website.

"The fighting happened after information that (President Hamid) Karzai's administration wanted to try several fighters in a cruel way in this court." (Agencies)