BAGHDAD, Iraq (CNN) -- U.S. troops fought it out with insurgents over the last 24 hours in and near Tarmiya, one of the many volatile spots on the northern Baghdad outskirts, the military reported Friday.
U.S. soldiers from Alpha Company run across a street during an operation in west Baghdad on Thursday.
A U.S. soldier and 13 insurgents, including an armed female wearing a ski mask, were killed. Also, a boy was killed in a building during fighting. Many people were detained as well.
The first incident occurred late Thursday when soldiers from Task Force Lightning came under attack from the Honest Mohammed Mosque -- a Sunni house of worship in Tarmiya.
A soldier was killed and another was wounded.
The troops are from 4th Stryker Brigade Combat, 2nd Infantry Division, serving with the U.S. force in northern Iraq called Task Force Lightning.
The ambush was followed by more fighting as an air weapons team struck insurgents on the mosque roof with a Hellfire missile. The U.S. military reported the incident Friday.
Troops "were attacked at their outpost with heavy small-arms fire." Later, troops cordoned off the area, worked with the mosque's groundskeeper to "pacify" the situation and "conducted a tactical callout to individuals inside the mosque instructing them to come out."
Twenty people left the mosque and were detained, but there were armed people on the roof. The missile was fired at the pair, who were on a corner of the roof, which received minor damage, the military said.
"These insurgents displayed total disregard for the community by using a mosque, a sacred place for Muslims to worship, as a sanctuary to commit their acts of terror," said Maj. Mike Garcia, a U.S. military spokesman.
A separate incident involving another unit occurred east of Tarmiya on Friday. Coalition forces -- carrying out an operation "targeting an al Qaeda in Iraq cell leader who provides guidance to senior terrorist leaders" -- killed 13 insurgents and detained 12 people, the military said.
Attackers fired on troops from buildings as they approached, and the troops called in air support. The troops tried to take over certain buildings and urged people in those structures to leave, but "hostile occupants of one building refused to comply," the military said.
Aircraft and sniper fire killed four armed insurgents who emerged from the building. One of them was "a female wearing a ski mask and wielding a rifle," the military said.
"Secondary explosions erupted from the building after it was engaged by the aircraft, indicating explosives stored inside." Ground forces called in more troops, who worked to secure more buildings.
Nine more insurgents were killed in the fighting, and 12 people were detained. "Despite coalition forces' appeals for the terrorists to send out women and children to be taken to safety, a boy was killed in a building with an armed terrorist who had engaged the ground forces," the military said.
Also on Friday, a roadside bomb killed a U.S. soldier in eastern Baghdad, the U.S. military said. The number of U.S. military deaths stands at 3,705, including seven military contractors. The number in August so far is 47, according to a CNN count of Pentagon figures.
Meanwhile, U.S. troop levels in Iraq will remain at about 160,000 through early 2008, Lt Gen. Raymond Odierno said Friday. A draw-down will be based on the results of what the Bush administration calls a "surge" -- the nearly 30,000 additional troops deployed in Iraq this year.
A withdrawal plan will develop depending on the security situation on the ground and the ability of Iraqi forces to become more proficient in security operations. Gen. David Petraeus, the top commander in Iraq, would make the final decision, Odierno said.
A troop withdrawal would eventually bring the force level down to the pre-"surge" troop level of more than 130,000 U.S. forces, he said.
Petraeus said Friday he thinks progress has been made with the military escalation in Iraq.
Asked about the effectiveness of the "surge," he told the Pentagon Channel, "we believe that we have taken the initiative away from the enemy" -- particularly the al Qaeda in Iraq militant group.
Petraeus cited Anbar province, the sprawling territory west of Baghdad, as the model of the progress being made in Iraq. He called the efforts there "dramatic."
Even with this, there is "still an enormous amount of work to be done" on the military level, he said. Al Qaeda in Iraq, Shiite militias and criminals remain major concerns.