Iranian rockets came about 1,500 metres close to US warships, including the aircraft carrier USS Harry S. Truman, entering the Gulf last week. The US military has called the Iranian live-fire exercise 'highly provocative'. 

The incident occurred on Saturday when the US warship, along with destroyer USS Buckley and a French warship, were moving through the Strait of Hormuz to help in launching aircraft for the US-led coalition campaign against the Islamic State. 

At the same time, the Iranian Revolutionary Guards conducted a live-fire exercise in the area and fired several unguided rockets, with one rocket coming about 1,500 metres close to the Truman, NBC News reported. The rockets were not fired at the ships but only near them, US military officials told the network. 

The US Central Command said that Iran had given "only 23 minutes of advance notification".

"These actions were highly provocative, unsafe, and unprofessional and call into question Iran's commitment to the security of a waterway vital to international commerce," spokesman Navy Commander Kyle Raines said, according to Reuters. 

"While most interactions between Iranian forces and the U.S. Navy are professional, safe, and routine, this event was not and runs contrary to efforts to ensure freedom of navigation and maritime safety in the global commons," he said. 

The Truman continued on to the Gulf following the incident, NBC reported. 

Iran and the United States only recently restored ties after reaching a nuclear agreement in July to stop Tehran's nuclear programme, while lifting the heavy economic sanctions on the country.