The Nato-led International Security Assistance Force (Isaf) said those killed in the raid in Sayed Abad district were suspected "insurgents" and a Taliban commander had been detained.
"There were 12 women and 15 children in the area who were protected. No civilian casualties were reported in our channels," Captain Ryan Donald, an Isaf spokesman, said.
"An investigation has been launched to find out if civilian casualties have happened."
Isaf said its troops only opened fire after men in the house had drawn weapons.
"The assault force engaged the threat, killing the men. After securing the compound, the assault force detained one suspected insurgent," a Nato statement said.
Villagers said there was no fighting before the troops entered the house.
"They were sleeping in one room and suddenly the soldiers broke the glass window and they fired on them and killed them," Mahmoud Khan, a relative who lives in the village, was quoted as telling The Associated Press news agency.
The issue of civilian casualties is sensitive in Afghanistan, where nearly 150,000 foreign troops have been waging a nearly nine-year military campaign.
The UN said this week that the number of civilian casualties was up one-third in the first half of 2010, with fighters killing seven times more civilians than Nato-led troops.
However, 386 civilians were killed by Nato or Afghan government forces, including 41 during search-and-seizure operations such as night raids, according to the UN.
In a incident on Wednesday, a woman was killed in crossfire between Isaf and Taliban forces in the southern province of Helmand , Isaf said.
Meanwhile, the Nato-led force also said it killed more than 20 anti-government fighters during ongoing operations in the eastern province of Paktia.
"This area is a known Haqqani network safe haven and used to stage attacks into Kabul and the Khost-Gardez pass," Isaf said.
"An air weapons team suppressed the enemy, resulting in more than 20 insurgents killed so far."
The Haqqani network, headed by Jalaluddin Haqqani, and his son, is based mainly in Pakistan's North Waziristan and adjoining provinces in Afghanistan. It has staged several high-profile attacks, including an assassination attempt on Hamid Karzai, the Afghan president, in 2008.