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 on 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.

The remarks by the acting commander of the Guard also follow those of Supreme Leader Ayatollah Ali Khamenei who 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 its nuclear deal with world powers.

In his remarks, Salami said that "Americans should learn from recent historical truths," 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 the sailors on their knees with their hands on their heads.

Get Breaking News Delivered to Your Inbox

"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.

He added: "Americans cannot make safe any part of the world."

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-defense."

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. 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 aboard.

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 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 also 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.