MOSUL, Iraq (Reuters) - Attacks on U.S. forces in Iraq by Iran-backed militia have fallen sharply thanks to U.S. and Iraqi military operations and diplomatic engagement with Tehran by Baghdad, top U.S. military officials said Monday.

The upbeat assessment signals a shift from only three weeks ago when visiting Defense Secretary Leon Panetta strongly urged Baghdad to do more against Shi'ite Muslim militias responsible for making June the deadliest month for U.S. forces in Iraq since 2008.

He warned that the United States would take unilateral action if necessary.

Admiral Mike Mullen, the top U.S. military officer, credited U.S. and Iraqi actions as he arrived on an unannounced visit to Iraq, possibly his last before stepping down as chairman of the Joint Chiefs of Staff at the end of September.

"We've done this. The Iraqi security forces have done it. The political leadership has addressed it. And so you've seen in the last two to three weeks a dramatic reduction in that (violence)," Mullen told reporters flying with him to the northern city of Mosul. "I'm still in the wait-and-see mode to see whether or not this can be sustained."

Fourteen U.S. service members were killed in hostile incidents in June. Most of the deaths were attributed by U.S. officials to rocket attacks by Shi'ite militias armed by Iran.

General Lloyd Austin, the commander of U.S. forces in Iraq, cited three operations that resulted in the detention of suspected militants behind the rocket attacks.

"We have increased the pressure on those networks ... working with our Iraqi counterparts, and I think we've had some pretty good effects over time," Austin said.

Briefing a small group of reporters, Austin also credited Iraqi political efforts to send a strong message to Iran against the violence.

"I can't speak specifically about whatever communications have gone back and forth between the Iraqi leadership and the Iranians," Austin said. "But I can tell you that I believe that the government has pushed back on the Iranians and so we're seeing some of those results."


Prime Minister Nuri al-Maliki's shaky coalition government has yet to decide whether it will ask the United States to keep some of the 46,000 remaining U.S. troops in the country beyond a 2011 drawdown deadline, despite U.S. and Iraqi military concerns about security gaps once American forces leave.

U.S. officials are warning Iraq's government that, without a request from Baghdad soon, it will become increasingly difficult and costly to alter the U.S. withdrawal plan, a matter Mullen said he would raise with Iraqi leaders on his visit.

"The point is, you know, we're at a deadline. We need an answer," Mullen said.

Any decision to extend the U.S. troop presence is risky in Iraq. The political bloc of anti-U.S. Shi'ite cleric Moqtada al-Sadr openly opposes a U.S. presence and Sadr has threatened to escalate protests and military action if troops stay.

One option being floated in Iraq is to have private contractors train Iraqi forces, instead of active-duty U.S. military personnel.

But a U.S. defense official speaking to Reuters earlier this month on condition of anonymity did not expect any future U.S. training mission being relegated solely to contractors, were Iraq to request some residual U.S. military presence.

U.S. officials say Iraq will experience security gaps in areas including air defenses, intelligence and logistics should all U.S. forces leave.

"We understand and they understand where their gaps might be," Mullen said. "What steps any leader of any country wants to take to mitigate that risk is going to be up to them."

(Editing by Mark Heinrich)