JALALABAD, Afghanistan (Reuters) - Afghan security forces battled for hours against a group of attackers who stormed a government building in the eastern city of Jalalabad on Sunday after a coordinated assault that killed at least 15 people and wounded 42, local officials said.

A car bomb was detonated at the entrance to the state accounts office before a group of about six attackers armed with machine guns and rocket-propelled grenades rushed the building, the officials said. There were multiple blasts as they fought off security forces in a gun battle that lasted much of the day.

Islamic State claimed responsibility for the attack, in a busy area of the city with many other official buildings nearby, including a school in which about 1,000 girls were trapped as the fighting raged.

It was the latest in a series of high-profile attacks that have killed and wounded hundreds of civilians in Afghanistan this year and put heavy pressure on the Western-backed government of President Ashraf Ghani.

Most have been in capital city Kabul, but in January gunmen attacked an office of aid group Save the Children in Jalalabad, killing at least five people and wounding 25. That attack, also claimed by Islamic State, followed much the same pattern as Sunday’s incident.

After several hours of fighting that sent plumes of smoke rising into the sky above the accounts office, Attahullah Khogyani, a spokesman for the provincial governor, said that Sunday’s clash had ended with all the gunmen killed.

Public health officials said that at least 15 people, including a child, had been killed and 42 wounded. Witnesses said the explosions had caused carnage among passers-by.

Slideshow ( 8 images )

“I saw two rickshaw drivers on the ground with their arms blown off,” said Khan Mohammad, a local resident who saw the initial blasts and the start of the gun battle.

Violence has escalated across Afghanistan since the announcement of the Taliban’s annual spring offensive last month and there have been heightened security fears around preparations for elections in October.

Dozens of people have been killed in voter registration centers in recent weeks, leading to fears that people could stay away from elections that are seen as a major test of the government’s credibility.

At the same time, Taliban fighters have stepped up the pressure on government forces across the country, from Baghlan province in the north, where they seized a district center last week, to Farah in the southwest or Ghazni, south of Kabul.

Last year, the United States increased its support to struggling Afghan forces, announcing plans for thousands of additional advisers and more air strikes in an effort to force the Taliban to enter peace negotiations.