The Iranian-supplied rockets were raining down on Gen. James N. Mattis’s troops throughout the spring and summer of 2011 with greater and greater intensity.

Six American soldiers were killed by a volley in eastern Baghdad in early June. A few weeks later, three more Americans died in a similar strike, driving the monthly death toll to 15. It was the worst month for U.S. troops in Iraq in more than two years, and Iran’s proxies were vowing more rockets and more bloodshed.

Mattis, the top American commander in the Middle East, was determined to send a clear message to Tehran to stop it. His proposal, crafted with the support of the ambassador and the senior American commander in Iraq, was to hit back inside Iran, said current and former senior U.S. officials, who took part in the debate.

One option was a dead-of-night U.S. strike against an Iranian power plant or oil refinery, said the officials, speaking on the condition of anonymity to discuss sensitive operations.

“You could let them know that we have rockets, too,” one senior U.S. official said of the options forwarded by Mattis to Washington.