The explosion in the eastern city of Jalalabad also left at least five people wounded and set a nearby petrol station alight, the provincial governor's spokesman Attaullah Khogyani told AFP.
Some of the victims were brought to hospital with severe burns, health director Najibullah Kamawal said, confirming the casualty toll.
"I saw a big ball of fire that threw people away. The people were burning," Esmatullah, who witnessed the incident, told AFP.
Tolo News posted a video online purportedly showing several burned-out vehicles and gutted shops at the scene of the attack.
The Islamic State group claimed the attack via its Amaq propaganda agency -- the latest carried out by the extremists in restive Nangarhar province, which borders Pakistan.
Islamic State has claimed a series of high-casualty suicide bomb attacks in the province in recent weeks, as US and Afghan forces continue offensive operations against the group.
While the Taliban is Afghanistan's largest militant group, Islamic State has a relatively small but potent presence mainly in the east and north of the country.
US soldier killed in 'apparent insider attack' in Afghanistan: NATO
Tuesday's attack comes a day after US Secretary of State Mike Pompeo expressed 'hope' for peace talks between the Afghan government and Taliban, during an unannounced visit to Kabul.
Pompeo's first trip to Afghanistan since he was sworn in as America's top diplomat in April came amid renewed optimism for peace in the war-weary country, following last month's unprecedented ceasefire by the Taliban and Kabul during Eid.
The Islamic holiday was marked by spontaneous street celebrations involving Afghan security forces and Taliban militants, raising hopes peace was possible after 17 years of war.
"An element of the progress is the capacity that we now have to believe that there is now hope," Pompeo told a joint press conference with Afghan President Ashraf Ghani.
Afghan cricket stadium attack leaves 8 dead, 45 wounded
"Many of the Taliban now see that they can't win on the ground militarily. That's very deeply connected to President Trump's strategy," he said, referring to Trump's much-vaunted South Asia policy announced last August.
The ceasefire did not extend to the Islamic State franchise in Afghanistan, which first emerged in the country in 2014 and established a stronghold in Nangarhar before spreading north.
The most recent major attack in Jalalabad on July 1 saw 19 people killed and 21 wounded when a suicide bomber blew himself up in a crowd of Afghan Sikhs and Hindus.
The group had been waiting to meet Ghani, who was visiting the city, when the bomber struck.
That came after two separate suicide attacks in Nangarhar during the ceasefire that were also claimed by Islamic State.
Afghanistan extends Taliban ceasefire after suicide attack kills 25
Violence is expected to continue ahead of Afghanistan's long-delayed legislative elections on October 20 that militants have vowed to disrupt.
Afghan security forces, already struggling to beat back the Taliban and IS on the battlefield, will be responsible for protecting polling stations, many of which will be located in schools.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ