American military commanders attribute the drop in deaths to the Iraqi government finally pushing back against Iran and the Shiite militias, as well as aggressive unilateral strikes by United States forces. If the Americans are correct, and August is not just a statistical blip, it may also be connected to the continuing negotiations between American and Iraqi officials over whether to leave some troops behind after the end of the year, experts said. Though all sides in Iraq have said they want the Americans to leave, each has some interest in seeing that some troops stay behind.

The Iraqi government continues to rely on American forces and expertise to preserve security. Shiite militias would lose some of their rationale for existence, and Al Qaeda and Sunni insurgents could lose a useful foil. For the United States, domestic political concerns would also make it easier to sell an extension to a war-weary public if there were fewer casualties.

“The militia groups involved are being paid by the Iranians to make trouble for the Americans, and that means that their main objective is no longer there if the Americans withdraw all their troops,” said Joost Hiltermann, the International Crisis Group’s deputy program director for the Middle East. “It doesn’t mean they won’t exist altogether, but their violence will be harder to justify.”

American military and diplomatic officials said Iraq has not only pressed the militias, but also sent word directly to Tehran to back off on attacks. The Iranians had used the militias, which are primarily based in the southern part of the country and Baghdad, to wage a proxy battle with the Americans for dominance and influence in Iraq. Those militias were responsible for 12 of the 14 deaths in June, many the result of rocket or mortar attacks on military bases.

American officials increased pressure on Iraqis to clamp down after the spate of attacks in June, and Iraq eventually responded. The government increased its counterterrorism operations against the militias, brought judges from Baghdad into the southern part of the country to ensure those captured were not summarily released, and replaced poorly performing generals, officials said.