Mr Rouhani said the country would not be seeking permission from anyone to “defend” itself, despite threats from US President Donald Trump.
Soon after the defiant remarks, the head of Iran’s Revolutionary Guards aerospace division, Amirali Hajizadeh, told Tasnim news agency the force has a new ballistic missile, capable of carrying several warheads up to 2,000km.
The moves come just days after an inflammatory speech by Mr Trump at the United Nations, in which he verbally attacked Iran and suggested he would end the 2015 nuclear deal with the country.
Speaking at a parade commemorating the country’s bloody war with Iraq, Mr Rouhani said: “We will increase our military power as a deterrent.
“We will strengthen our missile capabilities … We will not seek permission from anyone to defend our country.”
Mr Rouhani also said Tehran would keep supporting the “oppressed people of Yemen, Syria and Palestine”, a reference to Iran’s role in wars in Yemen and Syria and support for Palestinian militant groups such as Hamas.
The agreement, in which Iran agreed to limit its nuclear programme in return for the lifting of economic sanctions, was hailed as a major step forward in diplomatic relations between the two countries.
But Mr Trump has long derided the deal, and frequently cited it during his election campaign as an example of how American power was being lost.
Mr Rouhani has maintained it cannot be renegotiated.
He branded Mr Trump a “rogue newcomer” to international relations and said his approach to the deal was “ignorant and absurd”.