Afghan authorities were searching Tuesday for about 270 inmates -- most of them Islamic State fighters -- who remained on the loose after escaping during a deadly prison raid.

At least 29 people were killed when Islamic State (IS) gunmen attacked the facility in Jalalabad on Sunday, with fierce fighting lasting until Monday afternoon.

More than 1,300 inmates tried to escape, a senior Afghan security official told AFP on condition of anonymity, but most were either swiftly re-arrested or surrendered when surrounded by security forces.

But some 270 prisoners are "still on the loose", the official said.

A man watches from behind a closed gate after a raid at the prison in Jalalabad
A man watches from behind a closed gate after a raid at the prison in Jalalabad AFP / NOORULLAH SHIRZADA

"Most of those who escaped are from ISKP," he said, referring to IS's Afghan branch, known as the Islamic State in Khorasan Province.

They included militants responsible for several bloody attacks, a second security official told AFP.

Nangarhar provincial governor's spokesman Attaullah Khogyani confirmed many prisoners were still missing, but couldn't say how many were IS members.

Officials also said that security forces had shot dead on Tuesday another group of IS fighters who had launched a mortar attack targeting Jalalabad airport from a neighbourhood in the city around the same time when the prison raid commenced.

Afghan soldiers walk past the prison in Jalalabad after regaining control following the raid
Afghan soldiers walk past the prison in Jalalabad after regaining control following the raid AFP / NOORULLAH SHIRZADA

Several mortar shells and other ammunition seized from a house in the neighbourhood were shown to journalists.

The brazen prison raid came a day after Afghanistan's intelligence agency announced the killing of a top IS commander near Jalalabad.

Nangarhar province, where IS got its first foothold in Afghanistan, has seen repeated attacks by the group, including a suicide bomb that killed 32 mourners at a funeral in May.

Inmates peer out from behind a gate at the prison in Jalalabad
Inmates peer out from behind a gate at the prison in Jalalabad AFP / NOORULLAH SHIRZADA

The attacks have continued even though officials last year claimed IS had been defeated in Nangarhar.

"A large number of their leadership was arrested or killed... so it (the prison raid) was some sort of revenge to free some of their comrades," a senior Afghan security official said.

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

"They (IS) want to challenge the monopoly of the Taliban over militancy or anti-state violence in the country," said Abdul Sayed, independent researcher on jihadism in Afghanistan and Pakistan.

He said the Taliban, Kabul and Washington miscalculated about IS's defeat in Afghanistan.

"They (IS) now seem to have changed their strategies to (launch) high profile terrorist attacks in Nanagarhar to Kabul to provide proof of their existence," Sayed told AFP.

The prison raid shattered the relative calm of the final day of a three-day ceasefire between the Taliban and Afghan forces.

IS was not part of the truce.

The Afghan government still attempted to link the raid to the Taliban, which it said had violated the ceasefire 38 times.

Acting Interior Minister Massoud Andrabi said on Twitter that IS's new head in Afghanistan, Shahab Al-Mahajir, was a member of the Haqqani network, considered linked to the Taliban.

Washington has branded the Haqqani network, accused of carrying out numerous deadly attacks in Afghanistan, a terrorist organisation.