The strait, the narrow mouth of the Persian Gulf, has emerged as one of the top issues in negotiations to reach a permanent end to the Iran war.
The statement from the Khatam al-Anbiya military command, reported by Iranian state television on Thursday, came after both US and Iranian diplomats met mediators on Wednesday in Qatar.
It was not immediately clear what sparked the threat from Iran.
However, the US military's Central Command had put out a statement about having a meeting with officials from Middle Eastern nations in Bahrain that said "leaders underscored their shared commitment to the free flow of commerce through the Strait of Hormuz".
"Any failure to comply, deviation from the designated route, or disregard for the navigation protocols of the Islamic Republic of Iran in the Strait of Hormuz will be met with an immediate and forceful response from the armed forces, endangering the security of the violating vessels," the Iranian statement said.
It also said the continued presence of US fighter jets over the strait "causes insecurity in this waterway and threatens regional security".
"Any attempt by the United States to interfere in security matters or any disruptive action in the Strait of Hormuz will be considered a threat to Iran's national sovereignty and will be met with a rapid and decisive reaction," the Iranian warning said.
Iran and the United States agreed as part of an interim deal to allow ships to pass without paying charges for 60 days.
But Tehran insisted it must control the routes of the vessels and later charge fees for passage, upending decades of practice in the waterway.
The US and many Gulf Arab states say they will not agree to the charges.
An effort by Oman and a United Nations agency to launch a new route near Oman's shore sparked attacks across the Mideast last weekend, highlighting the tensions.