The incident occurred at about 5am local time on Sunday as a US navy cruiser, destroyer and frigate were on their way into the Gulf and passing through the strait - a major oil-shipping route.
Five small boats began advancing on the ships, dropping boxes in the water in front of the ships and forcing the US ships to take evasive manoeuvres, the Pentagon official said.
Verge of firing
There were no injuries but the US official said there could have been, because the Iranian boats turned away "literally at the very moment that US forces were preparing to open fire" in self-defence.
Iran has confirmed the incident, with the foreign ministry saying that a confrontation was "something normal" and that it had been resolved.
Mohammed Ali Hosseini, an Iranian foreign ministry spokesman, suggested the Iranian boats had not recognised the US vessels.
But he played down the incident, suggesting it was an issue of mis-identification. He did not comment on the US claims of the Iranian boats' actions.
"That is something normal that takes place every now and then for each party, and it [the problem] is settled after identification of the two parties."
Alireza Ronaghi, Al Jazeera's correspondent in Tehran, said the commander of the country's Revolutionary Guards will appear before parliament on Tuesday to justify the measures taken by his forces to defend his country's territorial waters.
Ronaghi said that as this would be a closed hearing, the reported incident with the US ships may be discussed.
The incident comes just days before George Bush, the US president, arrives in the Middle East on a trip that some Iranian officials have said is designed to sabotage Tehran's good relations with countries in the region.
But Ronaghi said it was unlikely anyone in the Iranian administration or the armed forces would actively provoke such an incident with ships that were not in Iran's territorial waters.
US jets crash
Also in the Gulf on Monday, two US navy fighter jets collided in mid air while on "a routine mission in support of maritime security in the region".
The US navy said the two F/A-18 Super Hornets were providing "close air support from Iraq when they crashed", but all three pilots – two from one jet and one from the other - ejected safely.
They were brought back after the crash to the USS Harry Truman, the aircraft carrier they were operating from, and were in good condition, the US navy's 5th fleet said.
The navy said the cause of the accident was under investigation.
Lieutenant John Gay from the 5th fleet's headquarters in Bahrain said there was "no connection" between Monday's crash and the harassment by the Iranian boats.