NEW YORK (Reuters) - Iranian President Hassan Rouhani on Monday warned the United States against pursuing hostile policies toward Tehran, saying preventing Iran from exporting oil would be “very dangerous”, though he did not rule out talks between the two countries.

In May, U.S. President Donald Trump pulled out of the 2015 international nuclear deal with Iran and announced sanctions against the OPEC member. Washington is pushing allies to cut imports of Iranian oil to zero and will restore sanctions on Iran’s oil sales in November.

Under the accord, most international sanctions against Tehran were lifted in 2016 in exchange for Iran curbing its nuclear program.

“Imposing sanctions on Iran to prevent us from selling our oil will be very dangerous ... and it cannot succeed,” Iran’s students News Agency ISNA quoted Rouhani as saying in a meeting with senior editors of foreign media in New York.

Rouhani, who is in New York for the annual United Nations General Assembly gathering of world leaders, said Iran would only talk to Trump if his administration proved its trustworthiness. Economic pressure would not force Tehran to the negotiating table, Rouhani said.

“If Trump wants to talk to Iran, then he first should return to the nuclear deal,” Rouhani said.

Foes for decades, Washington and Tehran have been increasingly at odds since May, with some U.S. officials privately calling for regime change in Iran. In July, Trump said he would be willing to meet Iran’s leader without preconditions to discuss how to improve ties. Iran dismissed the offer.

FILE PHOTO: Iranian President Hassan Rouhani delivers a speech during the annual military parade marking in Tehran, Iran September 22, 2018. Tasnim News Agency/via REUTERS

Iran’s rial currency has lost half its value in the past few months and fear of economic hardship has led to sporadic protests in several cities, with ordinary Iranians chanting slogans against Iranian leaders.

Rouhani has sought to reassure Iranians, many deeply frustrated by high unemployment and low living standards, that Iran’s oil-reliant economy could withstand the U.S. pressure.

“The U.S. sanctions harms ordinary Iranians but also it puts pressure on foreign companies who have to withdrew from Iran’s market, fearing America’s sanctions,” Rouhani said.

Despite Iran’s fragile economy, weakened by decades of sanctions, corruption and mismanagement, it will be difficult for Rouhani to consider diplomacy with the United States, which is rejected by Iran’s powerful hardliners.

“Rouhani cannot take such a risk because, after Trump’s withdrawal from the deal, his hardline rivals are in a stronger position in Iran,” said an Iranian official.

European powers have scrambled to protect Iranian oil revenues and shield companies from the U.S. measures to keep them operating in Iran, but many firms have pulled out regardless.

Iran has threatened to withdraw from the nuclear accord unless European nations move to neutralize the consequences of Washington’s exit.

“Iran will remain committed to the deal ... as long as other members remain committed to the pact and fulfill their promises,” Rouhani said.

Some insiders said Rouhani holding talks with Trump would effectively kill the existing deal, which was championed by the Iranian president with the guarded backing of Iran’s top authority, Supreme Leader Ayatollah Ali Khamenei.

“Rouhani’s political career is in danger if he talks to Trump because then the multinational nuclear deal will be out of the picture and Rouhani will lose the support of his European allies for ignoring them,” said a senior Iranian official from Tehran.