At least 20 people have been killed in a raid claimed by the Islamic State group on an Afghan prison, officials said Monday, shattering a ceasefire between the Taliban and government forces marking the Muslim holiday of Eid al-Adha.

Fighting was still raging on Monday, a day after gunmen stormed the prison holding around 1,700 mostly Islamic State (IS) or Taliban inmates in the eastern city of Jalalabad.

The IS news outlet Amaq announced its fighters were behind the raid, according to the SITE Intelligence Group.

Gunmen remained holed up inside and around the prison, Nangarhar governor's spokesman Attaullah Khogyani told AFP.

Several armoured vehicles and scores of security personnel were seen deployed in the area, and gunfire and explosions could be heard.

Map of Afghanistan locating Jalalabad, where armed men stormed a prison in eastern Afghanistan on Sunday
Map of Afghanistan locating Jalalabad, where armed men stormed a prison in eastern Afghanistan on Sunday AFP / STAFF

Zaher Adel, a spokesman for the provincial hospital, said 20 people had been killed so far -- including security personnel.

The toll was expected to rise, he warned, as many of the more than 40 wounded people were in serious condition.

The raid shattered the relative calm of a ceasefire between the Taliban and Afghan government forces that started Friday and ended Sunday.

At the time of Sunday's attack, the prison held more than 1,700 inmates -- mostly IS or Taliban fighters, a security source told AFP.

About 700 who escaped have been re-captured, he said.

Afghan soldiers were rushed to the prison in Jalalabad
Afghan soldiers were rushed to the prison in Jalalabad AFP / NOORULLAH SHIRZADA

Khogyani said special forces had so far cleared four floors of a five-storey building outside the prison where several attackers had been holed up since Sunday night.

The attack was complex, with gunmen initially setting off an explosives-packed car near the prison.

They later opened fire on the guards at the facility from a nearby market, an official said.

The raid came a day after the country's intelligence agency announced the killing of a top commander of the Islamic State group near Jalalabad.

Assadullah Orakzai was involved in several deadly attacks against Afghan security forces, the National Director of Security said Saturday.

Afghanistan's eastern province of Nangarhar has seen some deadly IS attacks this year including a May 12 suicide bomb that killed 32 mourners at a funeral for a police commander.

The IS attacks continue despite government officials claiming last year that the group's Afghan branch had been completely defeated in Nangarhar.

Some local officials have, however, cautioned that elements of the group remained.

The province provided IS with its first foothold in the country in 2015