The Pentagon has condemned the manoeuvres of four Iranian boats in close proximity to a US Navy warship in the Persian Gulf this week as “harrassment” that was “unsafe and unprofessional”.

A spokesman for the Navy’s 5th Fleet said the four vessels from Iran’s Islamic Revolutionary Guard Corps had been provocative by coming too close to the USS Nitze, a Navy destroyer, in international waters around the Strait of Hormuz on Tuesday.

The boats allegedly continued to close in on the Nitze even as US sailors tried to warn them away by firing off flares and sounding the ships horns. Video of the event was acquired by the Associated Press.

Ignoring those warnings, the Iranian boats had come to within 300 yards of the destroyer, US officials asserted, before slowing down and then changing course.

Meanwhile the Pentagon on Thursday described a separate, arguably more serious encounter involving another ship, the USS Tempest. Officials said an Iranian boat was speeding towards it head-on and came within 200 yards only to turn around when a second US vessel nearby fired three warning shots.

The incidents further highlight the dangers of confrontation between the US and Iran in the Straits of Hormuz. On Thursday the the semi-official Tasnim news agency of Iran quoted General Hosein Dehghan voicing defiance in the face of the Pentagon’s complaints.

“If any foreign vessel enters our waters, we warn them, and if it's an invasion, we confront,” Gen. Dehghan reportedly said, insisting also that Iran’s boats are entitled to patrol the waters of the Gulf to monitor traffic and foreign vessels in its territorial waters.

Tensions almost spilled over in January when Iran detained a group of 10 US Navy sailors who had seemingly erred into Iranian waters accidentally on launches. They were later released, but the brief capture of the Americans was seized upon by Republicans in the US presidential contest as evidence of weakness on the foreign stage on the part of Barack Obama.

The 5th fleet spokesman, William Urban, described what happened on Tuesday as a “high speed intercept” by the Iranian boats.