Iranian President Hassan Rouhani threatened Tuesday to abandon a landmark nuclear accord with world powers and restart the country's nuclear program if the United States continues to impose new sanctions.

"Those who are trying to return back to the language of sanction and threatening are imprisoned in their own past illusions," he said in a speech to parliament.

"If they are willing to get back to those experiences, Iran will definitely return to a much more advanced state of the pre-negotiations era in a short time -- it is just (a) matter of hours or days," he said.

In July 2015, Iran and six major powers -- Britain, China, France, Germany, Russia and the United States -- struck a deal formally called the Joint Comprehensive Plan of Action in which Iran pledged to curb activities such as uranium enrichment.

However, the U.S. administration of President Donald Trump has been tightening sanctions on Iran, citing the country's ballistic missile program.

Rouhani said Washington turned out to be "not a good partner" after ignoring international agreements ranging from the JCPOA to the Paris Agreement on climate change to the Trans-Pacific Partnership free trade deal.