The Taliban claimed responsibility, saying it was a suicide attack by a sleeper agent who had joined the Afghan army so that he would be able to kill foreigners.
The explosion occurred in an area of the Gardez army base where shopkeepers sell goods to both Afghan soldiers and their partnered NATO troops, said Rohullah Samon, a spokesman for the Paktia provincial government. He said his reports showed that the source of the blast was a bomb that had been planted in the area.
NATO said in a statement that two members of the military coalition died in the attack. They did not identify the victims or give their nationalities.
Two shopkeepers were killed and at least 18 people were wounded, Samon said.
Most of the NATO forces in Gardez are American. He said he did not have information on whether any troops had been killed.
A Taliban spokesman said in an e-mail sent to media outlets that the civilians who were killed were not innocent because they had collaborated with government and NATO forces.
"They were at the service of the foreigners," Zabiullah Mujahid said.