A roadside bomb in the east killed two NATO troops and wounded a third on Monday, the alliance said in a statement.
The U.S.-led troops in southern Afghanistan were raiding compounds suspected of housing bomb makers in the Garmser district of Helmand province on Sunday when militants attacked them with heavy fire, the statement said. Coalition forces responded with small-arms fire, killing several militants, it said.
"During one of the engagements, several militants barricaded themselves in a building on the compound and engaged coalition forces with a high volume of gunfire. Coalition forces used a single grenade which killed the attacking militants," the statement said. "However, the building the militants were fighting from collapsed."
After the clash, troops recovered the bodies of a woman and two children from the collapsed building, along with several militants and their weapons, it said.
Another woman was wounded during the battle and was taken to a medical facility for treatment. Two suspected militants were detained for questioning, the coalition said.
"We would like to express our heartfelt condolences to the families and loved ones of the deceased," said Maj. Chris Belcher, a coalition spokesman.
"When militants knowingly engage coalition forces with innocent people in the background, it only shows the extremists' complete disregard for innocent lives," Belcher said in a statement.
It was not possible to verify the coalition claims. Qari Yousef Ahmadi, a Taliban spokesman, said that only three militants were killed during the battle and 15 other victims were civilians. Ahmadi's claims are not always reliable.
Civilian casualties have incited resentment and demonstrations against U.S. and NATO forces in the past, though officials blame militants for using civilian homes as cover during clashes. President Hamid Karzai has pleaded with Western forces to do all they can to prevent such deaths.
In the east, a roadside bomb exploded, killing two NATO troops and wounding a third while they were conducting a combat patrol Monday, a statement said.
NATO did not identify the nationalities of the troops. Most of the soldiers in the east are American, but a contingent of Polish soldiers also serves there.
In central Ghazni province, militants ambushed a police convoy on Sunday, killing four officers and wounding two others wounded, said Ghazni's police chief Gen. Ali Shah Ahmadzai.
More than 5,800 people, mostly militants, have died in insurgency-related violence this year, a record, according to an Associated Press count based on figures from Western and Afghan officials.