At least four people had been killed and 20 wounded, a spokesman for the Nangarhar provincial governor told the media.
Public health officials said that at least 15 people, including a child, had been killed and 42 wounded.
A gun battle ensued between Afghan security officials and the militants, according to Al Jazeera. He said security forces had arrived at the site engaging the insurgents. Witnesses said the explosions had caused carnage among passers-by. Then more explosions were then heard coming from inside the building, witnesses said.More news: Pakistan, Ireland historic test begins in Dublin today
No one immediately claimed responsibility for the attack.
The militant attack is the latest in a series across Afghanistan this year.
However, the Taliban is now taking part in its annual spring offensive and has launched a number of attacks in recent weeks. The Taliban have seized control of districts across the country, and the two groups have carried out attacks in the Afghan capital, Kabul, in recent months that killed scores of people.More news: Bombings claim 13 in Indonesia
Nine journalists, including AFP's chief photographer in Kabul Shah Marai, were among 25 people killed in a double suicide blast claimed by IS in the capital on April 30.
Kabul has become one of the deadliest places in the country for civilians as security forces struggle to keep the militants at bay following the withdrawal of North Atlantic Treaty Organisation combat forces at the end of 2014.More news: China's First Domestically Produced Aircraft Carrier Starts Sea Trials