Afghanistan's Defense Ministry condemned the incident and demanded punishment for those responsible. NATO called it a "regrettable incident and announced an investigation.
The deaths are likely to strain relations between NATO and Afghan forces at a time both are calling for a closer partnership in the fight against the Taliban.
The fighting began about 3 a.m. in the eastern Wardak province, when a joint NATO-Afghan force traded fire with another Afghan unit manning the outpost. NATO troops then called in an airstrike, killing the four Afghans, NATO and the Afghan ministry said.
Neither group confirmed the nationality of the NATO soldiers. Associated Press Television News footage of the aftermath showed American armored vehicles on the highway, about a half mile (a kilometer) from the hilltop outpost. The snow outside the fortified compound was blackened by the airstrike.
"Besides expressing heartfelt condolences to the families of the martyrs, the Afghan Defense Ministry is condemning this incident," the Afghan statement said, adding a delegation had been sent to the area to investigate. "After the investigation is completed, the Defense Ministry wants to bring those responsible to justice."
Provincial officials said the fighting was due to a misunderstanding as the joint NATO-Afghan force returned from an operation in the Sayed Abad district. Provincial spokesman Shahidullah Shahid said seven Afghan soldiers also had been wounded.
NATO said the Afghans began shooting first and the joint force returned fire before calling in the airstrike.
"We work extremely hard to coordinate and synchronize our operations," NATO spokesman Brig Gen. Eric Tremblay said.
It was believed to be the first fatal friendly fire incident since November, when eight Afghans
- four soldiers, three policemen and an interpreter - were killed during close combat amid a search for a missing U.S. paratrooper.
Afghanistan's Defense Ministry said at the time that the deaths had been caused by "an air attack by NATO forces" during the fighting.