It is the deadliest attack on foreign troops since August.
Brig Gen Wilson Shoffner, head of public affairs at NATO’s Resolute Support base in the Afghan capital Kabul, said in a statement that six foreign soldiers were killed and three wounded in the attack.
He said the attack happened in the vicinity of the Bagram airbase, which is the biggest US military facility in Afghanistan.
“We’re deeply saddened by this loss,” said Shoffner.
The nationalities of the troops were not immediately known.
Earlier, an Afghan official put the number of NATO personnel dead at three, with another two wounded.
Taliban spokesman Zabihullah Mujahid claimed responsibility on Twitter and said 19 soldiers had been killed and a number wounded.