Iranian officials said the attacks, confirmed by US officials, marked the beginning of a promised retaliation against the US for the killing of top Iranian military commander Qassem Soleimani.
"The fierce revenge by the Revolutionary Guards has begun," Iran's Islamic Revolutionary Guard Corps said in a statement on a Telegram channel.
The Revolutionary Guard later warned that if the US responds to its attack in Iraq, Iran "will respond to you in America".
US Defence Department spokesman Jonathan Hoffman said the rockets were clearly from Iran and the attacks were "targeted" at the bases in Ain Assad and Irbil.
Hoffman said the US was "working on initial battle damage assessments". There was no immediate word on injuries.
Iran's Revolutionary Guard said the Ain Assad air base was "completely destroyed".
The attack was "a total success by all accounts," the Revolutionary Guard said.
Iranian state TV said the attack was a revenge attack for the killing of Soleimani, whose funeral on Tuesday in his hometown of Kerman prompted angry calls to avenge his death, which drastically raised tensions in the Middle East.
State TV said the operation's name was "Martyr Soleimani."
It said the Guard's aerospace division that controls Iran's missile program launched the attack. Iran said it would release more information later.