Witnesses reported seeing missiles in the skies followed by explosions but it was not clear if there was any damage.
Iran announced on state television that it attacked US forces stationed at Al-Udeid Air Base in Qatar.
A caption on screen called it "a mighty and successful response" to "aggression" from the United States as martial music played.
The attack came shortly after Qatar closed its airspace as a precaution amid threats from Iran.
Just before the explosions, Iranian President Masoud Pezeshkian wrote on the social platform X: "We neither initiated the war nor seeking it. But we will not leave invasion to the great Iran without answer".
In the past, Iran has threatened US forces at Al-Udeid Air Base , which hosts the forward headquarters of the US military's Central Command.
Qatar, across the Persian Gulf from Iran, maintains diplomatic relations with Iran and shares a massive offshore natural gas field with Iran.
Iranian broadcaster said the country's missile barrage on Qatar was the same number of bombs used by US on its nuclear sites, in an apparent signal of a desire to de-escalate.
Earlier on Monday, Qatar shut down its airspace as part of measures taken amid developments in the region, a statement by the Qatari foreign ministry said.
The notice posted on the X platform said the move is to ensure the safety of residents and visitors.
The US embassy in Qatar emailed US citizens in the country on Monday recommending that they shelter in place until further notice, triggering a slew of messages from various Doha-based institutions to employees and students.
The United Kingdom government later issued a warning recommending the same for UK citizens in Qatar.
The US and UK messages noted that the recommendation was "out of an abundance of caution" and offered no further information.
Two US officials separately told Reuters that Iran could carry out attacks targeting US forces in the Middle East soon, with one source saying it could happen in the next day or two.
Israel struck the most notorious jail for political prisoners in Tehran on Monday in a potent demonstration that it was expanding its targets beyond military and nuclear sites.
Ebrahim Zolfaqari, a spokesman for Iran's Khatam al-Anbiya central military headquarters, issued an apparent threat to retaliate after US President Donald Trump approved attacks on Iranian nuclear sites at Fordow, Natanz and Isfahan.
"Mr Trump, the gambler, you may start this war but we will be the ones to end it," Zolfaqari said on Monday in an English-language video statement.
Iranian authorities have repeated earlier threats to retaliate against the United States but it had yet to do so in a meaningful way more than 24 hours after US bombers dropped 30,000-pound bunker-busters on Iran's underground nuclear sites.
Trump's administration maintains that its aim is solely to destroy Iran's nuclear program, not to open a wider war.
The US administration says it is still seeking a diplomatic resolution that would have Iran forgo any reprisal.
with AP and PA