Iran unveiled its first domestic fighter jet on Tuesday, with President Hassan Rouhani insisting that Tehran's military strength was only designed to deter enemies and create "lasting peace".
Images on state television showed Rouhani sitting in the cockpit of the new "Kowsar" fourth-generation fighter at the National Defence Industry exhibition in Tehran.
State media said it had "advanced avionics" and multi-purpose radar, and that it was "100% indigenously made" for the first time.
Footage of the Kowsar's test flights was circulated by various official media. But live footage of the plane taxiing along a runway at the defence show was cut before it could take off.
"When I speak of our readiness to defend, it means we seek lasting peace. If we lack readiness, we welcome war," Rouhani said in a televised speech shortly after.
"Some think when we increase our military power, this means we seek war. (But) this is peace-seeking because we don't want war to happen," he added.
"If we don't have a deterrent... it gives a green light for others to enter this country."
The plane was first publicly announced on Saturday by Defence Minister Amir Hatami, who had said it would be unveiled on Wednesday.
He gave few details of the project, focusing instead on Iran's efforts to upgrade its missile defences.
Hatami said the defence programme was motivated by memories of the missile attacks Iran suffered during its eight-year war with Iraq in the 1980s, and by repeated threats from Israel and the United States that "all options are on the table" in dealing with the Islamic republic.
"We have learned in the (Iran-Iraq) war that we cannot rely on anyone but ourselves," he said in a televised interview.
The US has sold hundreds of billions of dollars of weapons to Iran's regional rivals, but has demanded that Tehran curb its defence programmes, and is in the process of reimposing crippling sanctions in a bid to force its capitulation.
Rouhani said Iran must show restraint as well as deterrence, in an apparent swipe at his hardline opponents who seek to provoke the US with aggressive slogans.
"With a couple of sentences, one can start a fight. With a couple of military moves one can enter into confrontation. But then it will be costly," he said.
"The skill is to protect the country with minimum cost," he said. That mirrored a line from the defence minister, who said on Saturday: "Our resources are limited and we are committed to establishing security at a minimum cost."
Following the withdrawal of the United States from the 2015 nuclear deal in May, Iran has avoided an aggressive response and sought to maintain its goodwill with other international partners who oppose Washington's move.
Rouhani said US pressure was also a spur to action.
"Why does America impose economic sanctions on us? Why does it impose them on Turkey? Why does it drag China into an economic war? Because it feels each one of them has a weak point. We must fix our weak points."