Iranian President Hassan Rohani said Tuesday that Iran will remain in the nuclear deal despite President Donald Trump's decision to withdraw, adding that Tehran is ready to resume its nuclear work after holding talks with EU members of the deal.

Trump said he was reimposing economic sanctions on Iran and pulling the United States out of an international agreement aimed at stopping Tehran from obtaining a nuclear bomb.

Rohani called Trump's decision "illegal, illegitimate and undermines international agreements" and "a historical experience for Iran" on state TV, adding that the United States has never fulfilled its commitments.

Rohani noted that Trump has a history of undermining international treaties, saying there's a "short time" to negotiate with other world powers to keep nuclear deal in place.

Rohani said he instructed Foreign Minister Javad Zarif to negotiate with other countries in the nuclear deal, adding that that if negotiations fail, the Islamic Republic will enrich uranium "more than before ... in next weeks."

Saudi Arabia welcomed Trump's decision on Tuesday to withdraw the U.S. from the deal and to reimpose economic sanctions on Tehran.

"Iran used economic gains from the lifting of sanctions to continue its activities to destablise the region, particularly by developing ballistic missiles and supporting terrorist groups in the region," according to a statement carried on Saudi-owned Al Arabiya television.

Sunni Muslim Saudi Arabia, a key U.S. ally, has been at loggerheads with Shi'ite Iran for decades, and the countries have fought a long-running proxy war in the Middle East.