A Taliban suicide bomber wearing a military uniform hit an Afghan army base near the city of Jalalabad, the Afghan defence ministry said.
Coalition officials said five foreign troops died but gave no more details. Four Afghan soldiers and four translators were said to be injured.
The attack was one of the deadliest in months against foreign troops.
It took place shortly after 0730 (0330 GMT) when the bomber approached the gate of the military base and detonated his explosives.
The Taliban claimed responsibility for the bombing, adding that the attacker was a "sleeper agent" who had served in the army for at least one month before launching his attack.
However, Afghan officials strongly denied that suggestion, insisting that the bomber was wearing a military uniform but not a serving soldier.
Coalition officials in Afghanistan confirmed that foreign troops had died on Saturday but did not specify the nationalities of those killed.
"Five International Security Assistance Force (Isaf) service members died following an insurgent attack in eastern Afghanistan today," a statement said.
The attack was the third in four days blamed on Taliban rebels.
The first killed a tribal elder closely connected to Afghan President Hamid Karzai, while on Friday the police chief of the southern province of Kandahar was killed.
Khan Mohammad Mujahid - a former mujahedeen fighter - had survived two previous attempts on his life, one on his way home and another in his motorcade.
In the two most recent incidents, the attacker was wearing an offical Afghan uniform.
Despite a sales ban put in place to reduce the number of attacks, Afghan army and police uniforms are widely available throughout the country.
The Afghan National Army and Afghan police are two of the key institutions preparing to take over responsibility for security from international troops, the BBC's Bilal Sarwary reports from Kabul.
The Taliban are now deliberately targeting the army and police in an effort to undermine people's confidence in them and to stop Afghans enlisting in the security forces, he adds.