The United States and Iran have traded warnings over U.S. efforts to block Iran's oil exports, with Tehran suggesting that it could retaliate by blocking oil tankers from leaving the Persian Gulf.

The exchange began on July 4 when Iranian President Hassan Rohani, while visiting with Austria's leader in Vienna, hinted that Tehran will block shipments of oil from neighboring Persian Gulf countries such as the United Arab Emirates, Kuwait, and Iraq in response to the U.S. sanctions plan.

"The Americans say they want to reduce Iranian oil exports to zero.... It shows they have not thought about its consequences," Rohani said.

That comment prompted a senior Islamic Revolutionary Guards Corps commander to praise Rohani and say the elite military group is ready to carry out his policy.

"I kiss your hand for expressing such wise and timely comments, and I am at your service to implement any policy that serves the Islamic republic," Major General Qassem Soleimani said in a letter to Rohani published by state news agency IRNA.

Rohani was responding to a U.S. warning last week that Washington has told countries around the world that they must halt all imports of Iranian oil when U.S. sanctions against Iran go into effect on November 4 or face the possibility of U.S. financial penalties.

Rohani did not elaborate on his remarks, but Iranian officials have in the past threatened to block the Strait of Hormuz, a waterway at the tip of the Persian Gulf through which a large share of the world's oil shipments pass, in retaliation for any hostile U.S. action against Iran.

The Pentagon responded to the Iranian rhetoric with a vow to keep the critical waterway open.

Captain Bill Urban, a spokesman for the U.S. military's Central Command, told the Associated Press on July 4 that the U.S. Navy and regional allies "stand ready to ensure the freedom of navigation and the free flow of commerce wherever international law allows."

Rohani while in Vienna called the U.S. effort to block Iran's critical oil exports -- which are the economy's main driver and source of revenues -- along with other looming U.S. sanctions "crime and aggression," and he called on European leaders to resist them.

Rohani warned that European leaders must "guarantee" that Iran continues to enjoy the benefits of its nuclear deal with world powers -- including the freeing up of Iranian oil exports after global sanctions were lifted in 2016 -- or Iran may walk away from the deal like the United States did in May.

The leaders of Germany, Britain, and France -- the three European signatories to the nuclear deal -- have vowed to keep honoring the deal, but they have said that the looming U.S. sanctions make it difficult for them to give Tehran guarantees.

The United States also is pressuring Japan and other major buyers of Iranian crude oil in Asia to stop such imports.

But Kyodo news agency reported on July 4 that Tokyo has informed Washington that it cannot further cut or halt crude imports from Iran without harming Japan's economy.

At the same time, Kyodo reported that Japanese Prime Minister Shinzo Abe has abandoned his plans to visit Iran this summer in light of Washington's sanctions push against Iran.

With reporting by AP, dpa, and Reuters

