They can carry up to 32,000kg worth of bombs, which can include nuclear weapons.
The aircraft were conducting a “presence patrol” aimed at illustrating American power in the region.
In response Mohammad Jadif Zarif, the Iranian foreign minister, tweeted a chilling warning.
Addressing Donald Trump he said: “If your B-52H ‘Presence Patrols’ are meant to intimidate or warn Iran, you should have spent those $billions on your taxpayers health.
“While we have not started a war in over 200 years, we don’t shy from crushing aggressors.”
During the early stages of the 1980-1988 Iran-Iraq war the US provided support to Saddam Hussein’s Iraq which it viewed as a bulwark against religious extremism in Iran.
In a statement US General Frank McKenzie, from Central Command, said the mission was conducted to demonstrate the American commitment to the Middle East.
Two new Iranian warships, including the largest in the country’s fleet, took part in the exercise.
Iranian Admiral Kaviani commented: “The enemies should know that in the event of any violation and encroachment on the maritime borders of the Islamic Republic of Iran, they will be targeted with cruise missiles from the coast and the sea.”
Tensions between the US and Iran have been high around the one-year anniversary of Qasem Soleimani’s assassination.
The Revolutionary Guards commander was killed by a US airstrike near Baghdad International Airport on January 3.
American sources alleged he had been helping to organise terror attacks across the Middle East.
In response Iran fired ballistic missiles at a US military base in Iraq causing a number of injuries.
Tensions between Iran and the US soared during Donald Trump’s presidency.
In May Mr Trump withdrew the US from the Iran nuclear deal negotiated by Barack Obama.
The move was opposed by China, Russia, Britain, France and Germany; the deal’s other signatories.