An Islamic State group attack on a prison in eastern Afghanistan holding hundreds of its members continued on Monday after at least 21 people were killed in fighting overnight, a local official said.

Another 43 people have been injured in the attack, which began late on Sunday when an IS suicide bomber slammed his explosive-laden vehicle into the entrance to the jail in Jalalabad, capital of Nangarhar province, some 70 miles (115km) east of Kabul.

More assailants then opened fire.

Afghanistan
Afghan security personnel gather in front of the prison (Rahmat Gul/AP)

Three attackers have been killed so far but the battle was continuing on Monday with sporadic gunfire still coming from the prison grounds, said Attaullah Khogyani, a spokesman for the governor of Nangarhar province.

Some of the dead were prisoners, he said, as well as civilians, prison guards and Afghan security personnel.

IS’s affiliate in Afghanistan, known as IS in Khorasan province, claimed responsibility for the attack. The affiliate has its headquarters in Nangarhar province.

The motive of the attack was not immediately clear; however, another provincial official said some prisoners escaped during the fighting.

The prison houses about 1,500 inmates, of whom several hundred are believed to belong to the IS affiliate in Afghanistan.

Afghanistan
A wounded man receives treatment at a hospital after the suicide car bomb and gun attack in the city of Jalalabad (AP)

The attack came a day after the Afghan intelligence agency said a senior IS commander had been killed by Afghan special forces near Jalalabad.

While IS has seen its so-called caliphate stretching across Iraq and Syria eliminated after a years-long campaign, the group has continued fighting in Afghanistan.

The extremists have also battled the Taliban in the country, whom the US overthrew following the 2001 American-led invasion after the September 11 attacks.

The Taliban’s political spokesman, Suhail Shaheen, told the Associated Press that his group was not involved in the Jalalabad attack.

The US struck a peace deal with the Taliban in February.

A second, crucial round of negotiations between the Taliban and the political leadership in Kabul has yet to start. Nevertheless, Washington and Nato have already begun withdrawing troops in line with the deal.

“We have a ceasefire and are not involved in any of these attacks anywhere in the country,” he said.

Afghanistan
Afghan families leave their homes after the IS attack on the prison in Jalalabad (Rahmat Gul/AP)

The Taliban declared a three-day ceasefire starting on Friday for the major Muslim holiday of Eid al-Adha.

It expired at 12am local time on Monday, although it was not immediately clear if it would be extended as the US pushes for an early start to intra-Afghan negotiations which have repeatedly been delayed since Washington signed a peace deal with the Taliban in February.

The Taliban also denied being involved in a suicide bombing in eastern Logar province late Thursday which killed at least nine people and wounded 40 others.

Afghanistan has seen a recent spike in violence, with most attacks claimed by the local IS affiliate.