U.S. President Donald Trump on Tuesday kept open the possibility of negotiating an agreement to denuclearize Iran, two days after he rattled his saber at the nation on Twitter.

"We'll see what happens, but we're ready to make a real deal, not the deal that was done by the previous administration, which was a disaster ," he said during a speech to the Veterans of Foreign Wars.

Iran on Monday dismissed Trump's angry warning that Tehran risked dire consequences "the like of which few throughout history have suffered before" if it made threats against the United States.

Trump's defense secretary, Jim Mattis, declined to directly answer a question about whether he was concerned that Trump's rhetoric might ratchet up tensions in the region, increasing the chances of miscalculation.

But Mattis, speaking at a news conference in California, listed his many concerns about Iranian actions in the Middle East, including Tehran's support for President Bashar al-Assad in Syria's civil war and for Houthi militants fighting the internationally recognized government in Yemen.

"It's time for Iran to shape up and show responsibility as a responsible nation. It cannot continue to show irresponsibility as a revolutionary organization that is intent on exporting terrorism, exporting disruption, across the region," said Mattis, a retired Marine general.

"So I think the president was making very clear that they're on the wrong track."