The attacker detonated his explosives in the middle of the funeral ceremony in Kuz Kunar district on Tuesday, Atahullah Khogyani, spokesman for the governor of Nangarhar province, said.
Mourners had gathered for the funeral of the commander of the district's police force, Shaykh Akram, who died of a heart attack on Monday night, when the bomber struck, Khogyani said.
According to a provincial council member, dozens of people, including politicians, provincial council members and locals had gathered for the funeral of Shaikh Akram, the militia commander.
The Taliban denied responsibility for the attack.
Battle-weary Nangarhar near the Pakistan border has long been a stronghold for both ISIL (ISIS) and the Taliban and has witnessed some of the hardest fighting in recent years.
Separately, attackers stormed a maternity hospital in the western part of the Afghan capital on Tuesday, setting off a gun battle with police, officials said.
Afghan forces carried out newborn babies and their mothers as they evacuated the hospital. At least four people were reported wounded.
The violence comes just a day after four roadside bombs exploded in a northern district of Kabul, wounding four civilians including a child.
The bombings were later claimed by ISIL, according to the SITE intelligence group.
In March, at least 25 people were killed by a gunman at a Sikh temple in Kabul, which was later claimed by the group.
In recent months, the armed group has suffered mounting setbacks after being hunted by US and Afghan forces as well as Taliban offensives targeting their fighters, but it still retains the ability to launch major assaults on urban centres.
The Taliban has largely refrained from launching huge attacks on Afghan cities since February when they signed a landmark withdrawal deal with the US meant to pave the way for peace talks with the Kabul government.
Under the agreement, the Taliban promised not to target forces from the US-led coalition, but made no such pledge towards Afghan troops and has since stepped up attacks in the provinces.
Be Part of Quality Journalism
Quality journalism takes a lot of time, money and hard work to produce and despite all the hardships we still do it. Our reporters and editors are working overtime in Kashmir and beyond to cover what you care about, break big stories, and expose injustices that can change lives. Today more people are reading Kashmir Observer than ever, but only a handful are paying while advertising revenues are falling fast.