A security operation was helping to curb an increase in violence in Baghdad in recent months after a surge of bombings and shootings, America's two top generals in the Middle East said.

Still, there was more violence Thursday, with three car bombs in Baghdad and a series of bombings and shootings across the country that killed 16 Iraqis and two U.S. soldiers. Another U.S. soldier was killed Wednesday, the military said.

On Friday, a police officer was killed in a drive-by shooting in downtown Samarra, 60 miles north of Baghdad, police Capt. Laith Mohammed said.

CountryWatch: Iraq

U.S. authorities attributed the reported improved security situation in the city to a joint American and Iraqi operation to deal with violence in the capital. The U.S. military has said the operation, for which 12,000 troops were redeployed to Baghdad, aims at curbing mostly sectarian warfare.

Army Gen. George Casey, the top U.S. commander in Iraq, said the operation that began in early August was working.

"I think everybody has seen an improvement in the situation in Baghdad over the last weeks because of the operations of the Iraqi security forces supported by the American Army," he said. "And we're confident that we can sustain that."

Also Thursday, Gen. John Abizaid, the top U.S. commander in the Middle East, said after meeting with Iraqi President Jalal Talabani that he did not believe the country had fallen into civil war, although there is a danger that it could.

"I think Iraq's far from it. I think that there's been great progress in the security front here recently in Baghdad," he said.

Abizaid said he and Casey were "very optimistic that the situation will stabilize."

Col. Michael Shields, commander of the 172nd Stryker Brigade Combat Team, which has been helping in the Baghdad operation, said the operation was a success in the districts of Ghazaliyah in west Baghdad and Shula in the northwest of the capital.

"There was a marked decrease in murders and violence in both Shula and Ghazaliyah during this operation," he said in a statement released by the U.S. military command Friday. "We cleared over 20,000 buildings without incident, capturing several personnel, weapons and 15 caches."

The military command also said Friday that U.S. soldiers confiscated a weapons cache and arrested one suspect on Tuesday after searching a convoy of civilian vehicles. They seized 28 assault rifles, three machine guns, a sniper rifle and ammunition.

Although accurate casualty figures are not available and statistics have not been provided for violent deaths in August, an Associated Press count indicates a downwards trend. Reported deaths, however, are thought to be considerably lower than the actual number of people killed.

With one week remaining in August, the estimated number of Iraqis killed around the country was at least 605, according to an AP count. That number was about 60 percent of the estimated AP total of at 1east 1,015 killed for all of July.

But the government's count for the number of deaths in July was far higher at 3,500, including 1,500 in Baghdad alone.

Political and sectarian violence across Iraq increased after a Feb. 22 bombing of a Shiite mosque in the town of Samarra. Most of the violence has been sectarian, often involving death squads from the majority Shiites or minority Sunni Arabs.

"I think there's a large number of civilians that have been killed by various death squads," Abizaid said. "Certain militia groups have been responding in a way that's not in connection with the national government, and that situation is clearly not one that's good for Iraq."

He said the United States and its coalition partners want Iraqis to take control of security.

"Obviously, Iraqis being in control of their own future with their own national forces is what your country wants and what we want, and so we'll work together to help make that possible," he told Iraqi journalists.