Two Afghan anti-Taliban fighters were also wounded in the exchange at the walled compound outside the eastern Afghan city of Gardez, Col. Roger King said.
There were neither al Qaeda or Taliban in the compound, he said.
King blamed a lack of coordination for the error.
Earlier the U.S. military reported being attacked by men with rocket launchers they believed were al Qaeda or Taliban.
"We had no way of knowing they (the allied fighters) were there," King said. "These other forces were injected into the area without coordination."
Meanwhile, a new American general took control of the U.S.-led campaign in Afghanistan on Friday, acknowledging in an interview with The Associated Press that the hunt for elusive al Qaeda and Taliban fighters has gotten tougher.
Lt. Gen. Dan K. McNeill said he may have to adapt his tactics if Pakistan pulls out of the search. The threat of war with India has prompted Pakistan to say it will withdraw troops patrolling its side of the Afghan border — a move that would effectively give al Qaeda and the Taliban a refuge in Pakistan's western tribal region.
Many, if not all, of the top al Qaeda and Taliban leaders are thought to be in Pakistan. Those left in Afghanistan are avoiding battles, melting into the population, hiding in the rugged mountains and moving back and forth across the porous border.
McNeill has avoided commenting on the possibility of the United States expanding its search in western Pakistan, where some American special forces have worked in past months. But he said Pakistani withdrawals could lead to changes in his operations in Afghanistan. He did not say what changes.
"We will determine what it means to us, if indeed there are withdrawals," he said. "And if we need to make adjustments because of anything that's occurred in Pakistan, we will do so."
British troops have made four major sweeps for al Qaeda and the Taliban in the southeast region of Khost near the Pakistani border since March — without finding any fighters. The most recent British search, codenamed Operation Buzzard, was launched this week.
U.S. special forces have been searching in smaller groups in several border provinces. But whether they have been any more successful in finding hidden fighters is unclear.
McNeill would not say how many al-Qaida or Taliban fighters were thought to still be in Afghanistan.
A team of U.S. special forces had surrounded the compound in Khomar Kalay village in response to intelligence reports that al Qaeda and Taliban leaders were meeting there in the early hours Friday, King said.
But unbeknownst to the U.S. special forces, about 22 of their Afghan allies from a neighboring province had already occupied the compound, also apparently seeking al Qaeda members.
As the Americans moved in they saw movement within the compound, saw armed fighters emerge and moved to encircle them. One fighter pointed a rocket-propelled grenade at the Americans' vehicle and the special forces opened fire, King said. He suspected the Afghan anti-Taliban fighters had likely mistaken the U.S. special forces as enemy fighters.
After a brief firefight, the Afghan fighters lay down their arms. It was then that the Afghan soldiers with the U.S. special forces recognized the fighters as members of a group from neighboring Logar province, allied to the interim Afghan government, King said.
King said one of the Afghans who had been in the compound "said that they'd been sent there to kill al Qaeda."
No Americans were injured.
"Efforts will be made to place coordination measures into effect to prevent similar occurrences in the future," King said.
The wounded fighters were being treated at Bagram air base, the headquarters of U.S.-led forces in Afghanistan. The remaining men were freed.
In other developments:
Kabul international airport, whose tarmac was punctured on the very first night of U.S. bombing last October, should be repaired within a year to allow regular international flights, said Afghanistan's new civil aviation and tourism minister, Zalmai Rassoul.
Romania has offered to send up to 500 combat troops to help U.S.-led forces hunting Taliban and al Qaeda fighters.
The Balkan neighbors are hoping to win an invitation to join NATO at a November summit in Prague. Analysts say September 11 and warmer ties between Russia and the West may allow for a sweeping expansion of NATO in which up to seven former communist states, including Bulgaria and Romania, will be invited to join.