The Taliban denied responsibility for the attack on the mourners gathered in Khewa district of Nangarhar province on the border with Pakistan.
Islamic State militants are known to operate in the province.
Sohrab Qaderi, a member of Nangarhar's provincial council, said at least 50 people were killed or wounded. The member of parliament, Hazrat Ali, survived, he said.
Attaullah Khogayani, a spokesman for the provincial governor said up to 50 people were killed or wounded.
Islamic State fighters first appeared in eastern Afghanistan in around 2014 and battle the Taliban as well as government and foreign forces.
The Afghan affiliate of Islamic State, known as Islamic State Khorasan (ISIS-K), after an old name for the region that includes Afghanistan, has carried out some of the deadliest attacks in Afghanistan over recent years.
Also on Tuesday, unidentified gunmen attacked a hospital in the capital, Kabul, killing at least eight people.
No militant group claimed responsibility for either attack.