The Iranian military said the incident was "probably related to psychological problems of the soldier who suddenly started firing on his comrades".
An Iranian soldier opened fire on fellow soldiers at a military firing range south of Tehran on Sunday, killing four and wounding eight, the Iranian army said in a statement.
The shooting took place in the town of Kahrizak, which is about 10 km (6 miles) south of Tehran.
The army said the incident occurred probably because either the shooter had psychological problems or due to "the sudden and accidental swivelling of a weapon."
Last month, an Iranian serviceman shot dead three fellow soldiers at a barracks in the town of Abyek, about 40 km (25 miles) northwest of Tehran. He also injured six others before shooting himself, the Iranian Students' News Agency reported.
In that case, the shooter, who survived, had suffered from "temporary psychosis", medical officials told ISNA.