Iran's launching of more than a dozen missiles at American-led forces in Iraq on Wednesday came after years of preparing for a confrontation with its superpower foe, whose forces are vastly larger and more advanced.

The Persian Gulf country has more than 500,000 active-duty personnel, including 125,000 members of its elite Revolutionary Guard, according to a report last year by the International Institute for Strategic Studies. But international sanctions and restrictions on arms imports have made it hard for Iran to develop or buy more sophisticated weaponry.

To compensate for the imbalance, Iran has developed "asymmetric" responses — ballistic missiles, deadly drones and a web of militia allies in Iraq, Syria, Lebanon and Yemen, among other things — with the aim of being able to inflict pain while avoiding the traditional battlefield.