At an army barracks in Tehran last year, a private woke his sergeant one night, and marched him outside at gunpoint. The sergeant was made to writhe in the dirt for an hour, mimicking the exercises the private had been forced to do after he was drafted. The soldiers was believed to have been imprisoned for three years.

A 23-year-old draftee holed up with a loaded weapon in his room at a barracks in southern Iran, last July. His superiors had turned down his request for leave. He shot and wounded a police officer before killing himself.

In northern Iran, a soldier who was denied a transfer to another base opened fire on other soldiers, killing three and injuring six.

Another conscript gunned down three troops at a garrison in Tehran, in August, and wounded at least eight others before he was shot. He died on the way to the hospital.

Little information has been provided by officials or state media, but many young draftees say the violence is not surprising. They describe Iran’s military training as 21 months of physical humiliation, psychological stress, and petty corruption. It is an environment where mental health problems fester and socioeconomic grievances are magnified. Many soldiers said superiors harangue poor and disadvantaged recruits, while the wealthy and well-connected are not given difficult tasks. In fact, many avoid the draft, altogether.

“Almost everyone is a victim of hazing and mistreatment,” one soldier said. “I am educated, so I don’t have it as bad. But I hate the service and I hate my surroundings. I don’t feel any patriotism in my heart.”

Iran’s army is mainly a defensive force, one of the largest in the Middle East, with an estimated 350,000 active-duty troops. Nearly two-thirds of those troops are conscripts. It is not as powerful and well-financed as the elite Islamic Revolutionary Guard Corps, but the nation’s conventional army, or artesh, is been seen as a pillar of the Islamic Revolution at home.

Those who are entering the army at this time were all born after the 1979 revolution. According to experts, incidents such as the ones described signal a young generation’s increasing hostility to a ruling class that controls what they watch, wear, read and eat, and its worries about an economy that has failed to rebound despite the promises of the 2015 nuclear agreement. The prolonged economic crisis and growing resentment of clerics’ sweeping powers have dampened the Iranian peoples’ zeal.

A sociology professor at Dartmouth College, and author of “Democracy in Iran: Why It Failed and How It Might Succeed,” Misagh Parsa, said, “When you see things like this in the garrison, it’s a reflection of the broader problems in society,” and added, “The draftees, almost all of them, they know their future is bleak. They’re sacrificing two years of their lives, but for what? They are more agitated than previous generations because of all the social and economic failures and the absence of better alternatives.”

Iran uses a draft system, and service is mandatory for all males older than 18. Conscription began nearly a century ago under the former monarchy. Women were included until 1979, when the new Islamic rulers began enforcing segregation of the sexes. However, wealthy families pay fines to keep their children out of the draft, so the poorest Iranians are overrepresented in the forces. Uneducated soldiers are often sent to guard remote outposts, while those with connections can often negotiate undemanding desk jobs. These disparities appear to have been a factor in both of the recent shootings.

Following the shootings, Iran’s military announced that it will increase psychological screening of draftees.

The ISCA news agency quoted Army Brig. Gen. Kiyoumars Heidari as saying, “Today’s youth in our society are facing volatility and variables that have an impact on their minds and hearts. We must talk face-to-face with draftees and listen to them.”

Several politicians have called for abolishing the draft, including Mohsen Rezaei, a twice-failed presidential candidate who is now secretary of the Expediency Council.

A member of the Iranian parliament’s national security committee, Heshmatollah Falahatpisheh, calls the draft “an obsolete policy.” Falahatpisheh told the Fararu news website, “The army must be professional. Even the salaried army staff must undergo psychological exams before they join.”

Others said the draft served the interests of the theocracy, who would be less able to control a professional army.

A 27-year-old soldier named Morteza, said that since the shootings, physical training at his base has become less severe and psychologists have begun regular screenings of conscripts. “Before this, our mental health wasn’t examined,” Morteza said. “I sympathize with the guys who carried out those shootings. There is a lot of simmering frustration. The army doesn’t want to see those incidents repeated.”