Wednesday's attack took place in a marketplace in the city of Khost, near the Pakistani border and about 90 miles southeast of the Afghan capital, Kabul.
The assailant approached on foot through shops and taxi stands packed with people and then detonated his explosives as he approached Afghan and U.S. soldiers at a checkpoint, said Baryalai Wakman, a spokesman for the Khost provincial government.
Three U.S. soldiers and an Afghan interpreter were killed, according to American officials. A convoy in the area responded to the attack, said Maj. Martyn Crighton, a spokesman for NATO forces in Afghanistan.
Besides the interpreter, 17 Afghans also were killed, according to the Afghan president's office. Two were police officers and the rest civilians, Wakman said. An additional 32 people were wounded - all civilians, he said.
In nearby Logar province earlier Wednesday, a roadside bombing killed three women and four children crammed into a wagon pulled by a tractor. Four men were also wounded in the blast on a road outside the city of Pul-i-Alam, said provincial spokesman Din Mohammad Darwesh.
The bombings came a day after militants had carried out two attacks in southern Afghanistan, storming a NATO military base and attacking a police checkpoint. An unspecified number of U.S. troops were wounded in the attack on the NATO base, officials said.
On Monday, three gunmen dressed in Afghan police uniforms killed one American service member and wounded nine others in Kandahar's Zhari district. Nearly 1,900 U.S. troops have been killed in Afghanistan since the war began more than a decade ago.
Fighting usually picks up during the warm summer months, when it becomes easier for insurgents to travel into and around the mountainous country. This summer is particularly important for the international effort in Afghanistan, as it is the last fighting season before a significant U.S. military drawdown.
The commander of U.S. and NATO forces in Afghanistan, Marine Gen. John Allen, is scheduled to withdraw 23,000 U.S. troops by the end of September, leaving about 68,000 U.S. military personnel in the country. Allen is then expected to put together a recommendation for President Obama on how troop withdrawals should proceed next year.
Last year was the deadliest on record for civilians in the Afghan war, with 3,021 killed as insurgents stepped up suicide attacks and roadside bombs, according to the United Nations. The number of Afghan civilians killed dropped 36 percent in the first four months of this year compared with last year, though U.N. officials have said that a likely cause of the drop in violence was the particularly harsh winter.