It came days after US Secretary of State John Kerry paid a visit to Kabul to underscore his support for Afghanistan's beleaguered unity government and call on the insurgent group to resume direct peace talks.
"In the attack, 12 army recruits were killed," said Ataullah Khogyani, spokesman for Nangarhar province.
Ministry of Defence spokesman Dawlat Waziri confirmed the incident and death toll, adding the attacker struck the bus while riding a motorised tricycle.
Ehsansullah Shinwari, head of a regional hospital in Nangarhar province, said 38 people were hurt in the bombing.
More From This Section
Speaking from the hospital, Ahmad, who only uses one name, told AFP that his father and two brothers were killed in the attack.
At the site of the blast, bloodied clothes and personal belongings were strewn on the ground around the badly charred remains of the bus.
Taliban spokesman Zabihullah Mujahid later claimed responsiblity on his verified Twitter account. The group have been waging a revolt against the government since being toppled from power in 2001, frequently targeting the military.
Afghanistan, the US, China and Pakistan in January formed a four-way group to try to jump-start peace talks that were first held in Islamabad last July but fell away after it emerged later that month the Taliban's founder Mullah Omar was dead, leading to infighting within the group.
But the Taliban have refused to return to the negotiating table until their conditions are met, including the departure of 13,000 foreign soldiers who are on a mission to train and advise their Afghan counterparts.
The Syria-headquartered Islamic State group has also gained a foothold in Nangarhar province in recent years.
Brigadier General Wilson Shoffner, a spokesman for the US-led military operations in Afghanistan, said in March the group was mainly contained in one district of the province.
Many of them are former Pakistani Taliban fighters who "have changed allegiance to Daesh," Shoffner said, referring to the group by its Arabic acronym.