Iran will not wage war against any nation, Iran's President Hassan Rouhani said on Tuesday in a speech broadcast live on state TV.

Fears of a confrontation between Iran and the United States have mounted since attacks on two oil tankers at the entrance to the Persian Gulf on Thursday that Washington has blamed on Tehran.

"Iran will not wage war against any nation," Rouhani said. "Those facing us are a group of politicians with little experience."

"Despite all of the Americans' efforts in the region and their desire to cut off our ties with all of the world and their desire to keep Iran secluded, they have been unsuccessful."

Acting U.S. Defence Secretary Patrick Shanahan announced on Monday the deployment of about 1,000 more troops to the Middle East for what he said were defensive purposes, citing concerns about a threat from Iran.

U.S. Secretary of State Mike Pompeo said Tuesday that the United States will maintain its pressure campaign on Iran and continue to deter aggression in the region but does not want the conflict with Tehran to escalate.

"We have been engaged in many messages, even this moment right here, communicating to Iran that we are there to deter aggression," Pompeo told reporters at MacDill Air Force Base in Florida.

U.S. Secretary of State Mike Pompeo told reporters Tuesday that the troops are in the region 'to deter aggression.' (Piroschka Van De Wouw/Reuters)

The Chinese government's top diplomat, meanwhile, warned that the world should not open a "Pandora's Box" in the Middle East, as he denounced U.S. pressure on Iran and called on Tehran not to drop out of a landmark nuclear deal.

Speaking in Beijing after meeting Syria's foreign minister, Chinese State Councillor Wang Yi said the United States should not use "extreme pressure" to resolve issues with Iran.

"We call on all sides to remain rational and exercise restraint, and not take any escalatory actions that irritate regional tensions, and not open a Pandora's box," Wang said.

"In particular, the U.S. side should alter its extreme pressure methods."

Wang also said that the Iran nuclear deal was the only feasible way to resolve its nuclear issue, and he urged Iran to be prudent. U.S. President Donald Trump withdrew from the 2015 deal more than a year ago.

"We understand that relevant parties may have different concerns but first of all the comprehensive nuclear deal should be properly implemented," he added. "We hope that Iran is cautious with its decision-making and not lightly abandon this agreement."

China and Iran have close energy ties, and China has been angered by U.S. threats against countries and companies that violate U.S. sanctions by importing Iranian oil, including Chinese firms.

China has had to walk a fine line as it has also been cultivating relations with Iran's regional rival, Saudi Arabia, the Asian giant's top oil supplier.

Iran's foreign minister has visited China twice this year already. Saudi Arabia's crown prince has also visited Beijing this year.