A car bomb killed at least 26 people at a gathering of Taliban and Afghan armed forces in the eastern city of Nangarhar on Saturday, an official said, as soldiers and militants celebrated an unprecedented Eid ceasefire.

Islamic State claimed responsibility. The group's Amaq news agency said the target was "a gathering of Afghan forces" but gave no details. The Taliban had already denied involvement.

Dozens of unarmed Taliban militants had earlier entered the Afghan capital and other cities to celebrate the end of the Ramadan fasting season. Soldiers and militants exchanged hugs and took selfies on their smartphones.

Attaullah Khogyani, spokesman for the provincial governor of Nangarhar, confirmed a car bomb was responsible for the blast in the town of Ghazi Aminullah Khan, on the main Torkham-Jalalabad road, and said that dozens were wounded. He had earlier said a rocket-propelled grenade was to blame.

The Taliban announced a surprise three-day ceasefire over the Eid holiday, which began on Friday, except against foreign forces. It overlaps with an Afghan government ceasefire which lasts until Wednesday.

President Ashraf Ghani said in an address to the nation that he would extend the ceasefire with the Taliban but did not give a time-frame. He also asked the Taliban to extend their three-day ceasefire, which is due to end on Sunday and begin peace talks.

It was not clear if Ghani knew about the bomb in the east when he made his address.

US Secretary of State Mike Pompeo echoed Ghani's address, saying peace talks would have to include a discussion on the role of "international actors and forces".

"The United States is prepared to support, facilitate, and participate in these discussions," Pompeo said in a statement. "... The United States stands ready to work with the Afghan government, the Taliban, and all the people of Afghanistan to reach a peace agreement and political settlement that brings a permanent end to this war."

TRAFFIC JAMS

The Taliban are fighting US-led NATO forces, combined under the Resolute Support mission, and the US-backed government to restore sharia, or Islamic law, after their ouster by US-led forces in 2001.

NATO-led Resolute Support and US Forces-Afghanistan both said they supported Ghani's ceasefire extension.

Taliban wearing traditional headgear entered Kabul through gates in the south and southeast. Traffic jams formed where people stopped to take pictures of the fighters with their flags. The Taliban urged people to come forward and take selfies.

"They are unarmed, as they handed over their weapons at the entrances," Kabul police spokesman Hashmat Stanekzai told Reuters. Their weapons would be returned when they leave, he said.

Interior Minister Wais Ahmad Barmak met Taliban fighters in Kabul, Tolo news said, an unthinkable prospect just two weeks ago.

Video and pictures on news websites showed cheerful soldiers and Taliban hugging one another and exchanging Eid greetings in Logar province, south of Kabul, in Zabul in the south and in central Maidan Wardak. Some people were dancing and clapping as onlookers took photos.

Members of rights groups organised a brief meeting between Afghan forces and Taliban insurgents in Helmand's capital city, Lashkar Gah, where the Taliban have delivered a series of blows to government forces this year.

"HARD TO DESCRIBE THE JOY"

Men and women gathered around the soldiers and Taliban fighters and urged them to keep their weapons holstered before they hugged each other.

"It was the most peaceful Eid. For the first time we felt safe. It is hard to describe the joy," said Qais Liwal, a student in Zabul.

The main square of Kunduz city, capital of the province of the same name, which has witnessed a series of bloody clashes, became a friendly meeting ground.

Resident Mohammad Amir said his younger brother had told him the Taliban were casually entering the city.

"I could not believe my eyes," he told Reuters. "I saw Taliban and police standing side by side and taking selfies."

Photos on news websites showed armed police standing in line at the corner of the street hugging Taliban fighters one by one.

A video showed a huge crowd of people screaming and whistling as they welcomed the Taliban. In some districts of the eastern city of Jalalabad, civilians were offering dry fruit, traditional sweets and ice cream to Taliban militants.

A Reuters reporter in Jalalabad saw more than a dozen Taliban insurgents enjoying their food and playing with children.

The ceasefires, which follow months of deteriorating security, especially in the capital, Kabul, have coincided with the start of the soccer World Cup and the Afghan cricket team's test match debut against India. But with delayed elections scheduled for October still in doubt, Afghans still yearn for peace that lasts longer than a few days.

WATCH VIDEO | 10 journalists, 16 others killed in twin suicide bomb attacks in Kabul