At least four soldiers were killed and eight injured when one of their colleagues opened fire on a military air base in southern Tehran on Sunday, the Iranian military said in a statement.
The incident was "probably related to psychological problems of the soldier who suddenly started firing on his comrades," the statement said.
It took place on a shooting range, and could also have been the result of a gun misfiring, the statement added.
"The injured were transported to a medical centre and an investigation has been opened," it said.
State television reported a similar incident last month when a serviceman opened fire at a barracks in Abyek, around 40 kilometres northwest of Tehran, killing three and injuring six.
The gunman in that incident, who had reportedly been denied a transfer to his home town, shot himself but survived his injuries, according to the ISNA news agency.
Military service of two years is mandatory for Iranian men when they turn 19.