Washington: American troops are preparing to leaving Iraq by the end of this year, and military officials worry that Iran will get credit for that withdrawal, Gen. Martin Dempsey told lawmakers.

Dempsey, the White House’s pick to replace Joint Chiefs Chairman Adm. Mike Mullen, told members of the Senate Armed Services Committee that Tehran is providing weapons and support to anti-American forces in Iraq, especially in the southern part of the country.

That is part of a larger Iranian effort “to produce some kind of Beirut-like moment” to gain leverage over the fragile Iraqi government, Dempsey said, referring to the power vacuum that ensued after the 1983 bombing of the Marine Corps barracks in Beirut.

Based on first-hand reports from commanders on the ground, supported by other intelligence, Iranian actions in country are designed “to send [the] message that they have expelled us from Iraq,” the four-star general told members of the Senate Armed Services Committee.

Iran is clearly banking on its ties with radical Shi’ite cleric Muqtada al-Sadr to gain access to the government of Prime Minister Nouri al-Maliki. The flood of Iranian weapons and supplies into southern Iraq is Tehran’s way of hedging its bets.

But with the possibility that a reduced U.S. military could remain in Iraq past the new year, lawmakers wanted assurances that Iranian weapons would not kill any more Americans.

“It would be a gross miscalculation on the Iranian part to believe that you can be involved in killing Americans and nothing comes your way,” Sen. Lindsey Graham told Dempsey.

While the department is already moving to protect U.S. soldiers from the unique weapons Iran has supplied to Iraqi insurgents — such as the Explosively Formed Penetrator — Dempsey made clear that any loss of American lives as a result of Iran’s regional power play would not go unpunished.

“It would be a gross miscalculation to believe that we will simply allow that to occur without taking serious consideration of reacting to it,” Dempsey said.