WASHINGTON —The United States will act against Iran if all efforts to end its suspected nuclear weapons program fail, Defense Secretary Leon Panetta said.

“Military action is the last alternative when all else fails,” he said Tuesday, the last day of the annual policy conference of the American Israel Public Affairs Committee. “But make no mistake, if all else fails, we will act.”

Panetta’s pledge was the most explicit by an Obama administration official warning of military action.