TEHRAN, Iran -- The deputy commander of Iran's powerful Revolutionary Guard said Iranian forces will close the strategic Strait of Hormuz to the United States and its allies if they "threaten" the Islamic Republic, Iranian state media reported Wednesday.

The comments by Gen. Hossein Salami, carried on state television, follow a long history of both rhetoric and confrontation between Iran and the U.S. over the narrow strait, through which nearly a third of all oil traded by sea passes.

Iran's Supreme Leader Ayatollah Ali Khamenei on Monday criticized U.S. activities in the Persian Gulf. It's unclear whether that signals any new Iranian concern over the strait or possible confrontation with the U.S. following Tehran's nuclear deal with world powers.

"Americans should learn from recent historical truths," Salami said, likely referring to the January capture of 10 U.S. sailors who entered Iranian waters. The sailors were released less than a day later, though state TV aired footage of them on their knees with their hands on their heads.

"If the Americans and their regional allies want to pass through the Strait of Hormuz and threaten us, we will not allow any entry," Salami said, without elaborating on what he and other leaders would consider a threat.

"Americans cannot make safe any part of the world," he added.

Lt. Rick Chernitzer, a spokesman for the U.S. Navy's 5th Fleet in Bahrain, said American sailors "continue to operate in accordance with professional maritime standards and international law" in the Persian Gulf region.

"We remain thoughtful, vigilant and responsible mariners as we conduct our operations here," Chernitzer said in a statement to The Associated Press. "We do, however, reserve the inherent right to self-defence."

The U.S. and Iran have a long history of confrontations in the Persian Gulf. They even fought a one-day naval battle on April 18, 1988, after the near-sinking of the missile frigate USS Samuel B. Roberts by an Iranian mine during the Iran-Iraq war. That day, U.S. forces attacked two Iranian oil rigs and sank or damaged six Iranian vessels.

A few months later, in July 1988, the USS Vincennes in the strait mistook an Iran Air flight heading to Dubai for an attacking fighter jet, shooting down the plane and killing all 290 people onboard.

U.S. Navy officials say they face near-daily encounters with Iranian naval vessels. In January, an unarmed Iranian drone flew over a U.S. aircraft carrier in the Persian Gulf, the first such overflight since 2014, according to Navy records obtained by the AP.

The U.S. has also criticized what it called a "highly provocative" Iranian rocket test in December near its warships and commercial traffic. Iran said it has the right to conduct tests in the strait and elsewhere in Gulf.

Iran sank a replica of a U.S. aircraft carrier near the strait in February 2015 and has said it is testing "suicide drones" that could attack ships.

On, Wednesday, Iran filed a formal protest with the Swiss Embassy in Tehran, which handles American interests, over a resolution filed by Rep. J. Randy Forbes, R-Va., that referred to the body of water as the "Arabian Gulf" and objected to Iran's actions there.

A report by the state-run IRNA news agency quoted Iran's Foreign Ministry as saying the country will take any necessary action to maintain security, peace and stability of the Persian Gulf region.

Forbes said in a statement that the protests over the name are "indicative of Tehran's aspirations to control the Straits of Hormuz and turn the Gulf into an Iranian lake."

"Our Navy is the only thing preventing that from happening, and that's why Iran has been harassing our ships and sailors and trying to drive us out of the Gulf," he said.

Associated Press writer Jon Gambrell in Dubai, United Arab Emirates, contributed to this report.