"Whether you like it or not, we are going to strengthen our military capabilities which are necessary for deterrence," Rouhani said in a speech marking the anniversary of the outbreak of Iran's devastating 1980-1988 war with Saddam Hussein's Iraq.
"We will strengthen not only our missiles but also our air, land and sea forces... When it comes to defending our country, we will ask nobody for their permission."
Criticism by the Donald Trump administration of a 2015 nuclear deal between Iran and major powers, including the United States, has focused heavily on Tehran's continuing missile programme.
But Washington says they breach the spirit of the agreement as they have the potential to carry a nuclear warhead and has imposed new sanctions over Tehran's continuing launches and tests.
More From This Section
There has been some sympathy for the US position from France, whose President Emmanuel Macron said the deal could be expanded to ban missile tests and cut a sunset clause in the nuclear agreement that would see Iran resume some uranium enrichment from 2025.
But even he insisted that the core deal not be dumped.
But Trump, who this week described the deal as an "embarrassment", is due to report to the US Congress on October 15 on whether or not he believes that Iran is in compliance.
If, as now appears increasingly likely, he decides that it is not, it could open the way for renewed US sanctions and perhaps the collapse of the agreement.
Trump said on Wednesday he had made his decision but was not yet ready to reveal it.
"Regrettably, since the agreement was confirmed we have seen anything but a more peaceful, stable region and this is a real issue," Secretary of State Rex Tillerson told reporters at the United Nations.
Washington has been particularly concerned about Iran's heavy intervention in Syria on the side of the government of President Bashar al-Assad and its support for Shiite rebels in Yemen who control the capital in defiance of its Saudi-backed government.
But Rouhani ruled out any change of policy in the region.