Thirty years ago, during the demonstrations that led to the Shah’s downfall, one of the dominant images was scenes of uniformed soldiers firing live ammunition at protesters. This week, Iran’s clerics seem determined, at least, not to repeat that historic mistake. They remember that the daily news coverage of the Shah’s soldiers shooting and killing unarmed protesters precipitated the collapse of the regime.

Instead, bearded plainclothes militiamen have been attacking and harassing the demonstrators in Tehran this past week. These are Basijis, members of a civilian paramilitary organization founded by Ayatollah Ruhollah Khomeini in 1979. It was conceived of as a civilian auxiliary force subordinate to the Revolutionary Guards, and so it has functioned over the past three decades. During the eight-year Iran-Iraq war, fervent Basijis volunteered to serve on the front lines. For a time, very young Basijis were encouraged to offer themselves for martyrdom by clearing minefields with their bodies in what became known as “human waves”—literally walking to their deaths en masse so that more experienced soldiers could advance against the enemy. An Iranian friend of mine who is a war veteran described the Basiji boy martyrs as having played a tragic but significant role in the war, by providing Iran with a “flesh wall” against Saddam Hussein’s vastly superior Western-supplied military technology.

In peacetime, the corps lets the Islamic regime employ violence as a form of social control while retaining some plausible deniability; scruffy bearded men in civilian clothes are not, after all, uniformed soldiers. The Basij is now said to have some 400,000 active members nationwide, with perhaps a million more reservists; in some ways, their relationship to Iran’s Supreme Leader, Ayatollah Ali Khamenei, who is also their commander in chief, recalls the one between Nicolae Ceausescu and the loyalist miners trucked in from the Romanian countryside to strong-arm pro-democracy protestors. From 1997 to 2005, during the reformist presidency of Mohammad Khatami, the Basij showed its usefulness again, by attacking students at demonstrations. Some students were killed. The protests died out.

President Mahmoud Ahmadinejad, who I wrote about for The New Yorker in April, is a Basiji, and the organization has always been an important part of his power base. During the past four years, with Mahmoud Ahmadinejad as president and the reform movement dormant, the Basij has not been needed as shock troops. Instead they have made their presence felt by periodically throwing up traffic barricades on the streets of Tehran and stopping cars to smell the breath of drivers for evidence of illegal alcohol consumption, or to question couples about their marital status. These Basijis are usually scruffy working-class men, and thus bring an element of notional “class struggle” to the otherwise pragmatically lived lives of the citizens of the Islamic republic. Not surprisingly, among more educated and affluent Iranians, they are almost unanimously despised.

In the mass demonstrations that have taken place this week, the modus operandi of the Basijis has been brutal and predatory. They have used the same tactics as packs of African wild dogs worrying a herd of wildebeest. They choose their targets at the edges of the crowds, going for the vulnerable and unwary stragglers, and moving in as a group to reduce them with violence. Last Monday, the men who fired guns at demonstrators from the rooftops of buildings were almost certainly Basijis. They killed seven demonstrators at their leisure, and it also seems likely that they hoped this display of lethal intent would so intimidate the protesters that they would give up and go home. Clearly, that did not work, and it is probable that they were ordered to tone down such public displays of violence, at least for the time being. But they have continued to attack surreptitiously and in terrifying ways, jumping demonstrators as they return home on darkened streets at night. On Wednesday, there were reports that men who appeared to be Basijis had come onto theTehran University campus and had stabbed students with knives.

On a trip I made to Iran in 2006, a year after Ahmadinejad assumed the presidency, I met a Basij official, Dr. Mahdi Araby, who worked at the Tehran City Hall. In the late nineteen-nineties, Araby had been one of Ahmadinejad’s engineering students at the Iran University of Science and Technology, where Ahmadinejad was studying for his Ph.D. in traffic management. In 2003, after Ahmadinejad’s appointment as mayor of Tehran, he had asked Araby to come and work with him. Araby described Mayor Ahmadinejad as a man of pure heart and missionary zeal. “His original aim was not political,” explained Araby. “He just wanted to serve people.”

Araby pointed to a beige windbreaker that was hanging on a hook on the closed door of the room. I remarked that it appeared to be exactly like the jacket the president usually wore. He smiled proudly and said it was his. “It is the jacket of the Basij.” he said.

He then told me the following story. One night during Ahmadinejad’s time as mayor, Araby had been driving home when he saw an elderly couple standing by the side of the road and looking as though they were in distress. They were holding up a jerrican to show that they had run out of gas, but no one had stopped to assist them. Araby did. He instructed the old man how to siphon some petrol from his car, but the man had explained that he was asthmatic, so Araby did it himself. The old woman had wanted to pay him, but he had refused, telling them, “I am a Basiji. It is our duty to help.” Araby accidentally swallowed some of the petrol and had begun spitting up blood, so he ended up in hospital for three weeks. He explained that he had a lung problem from a chemical-weapon attack during the Iran-Iraq war. He smiled; his wounds, like his Basij jacket, were a badge of honor.

Next, Araby told me a story he had heard about Ahmadinejad while he was mayor. The story was that Ahmadinejad had been dressing up as a streetsweeper at night and going out with a work crew for an entire month, to understand what their life was like and decide how to pay them a fair wage. Araby had confronted Ahmadinejad about the story and asked if it was true. “He asked where I had heard it from, and he smiled,” said Araby. To him, Ahmadinejad’s reaction was a confirmation of the rumor. “Ahmadinejad is a true Basiji,” he said approvingly.

It was that same spirit that propelled Ahmadinejad into the presidential race, Araby believed. “I can tell you that, up to two months before the presidential election in 2005, he was undecided about running. But our people were fed up with the promises being made during the presidential campaign, and we realized that the middle-class people, and the people at the lower rungs of society, were not satisfied either.” Araby said, “He hadn’t planned to become president. We pushed him to do it.”

The Basij also connects Ahmadinejad to his spiritual mentor, Ayatollah Mesbah-e-Yazdi, a conservative hard-liner who is extremely hostile to the West and has frequently called for a stricter interpretation of Iran’s Islamic revolution, which he believes has strayed from the path set out for it by the late Imam Khomeini. Yazdi has frequently endorsed the use of violence against critics of the regime. In 2005, he openly and controversially encouraged his followers to vote for Ahmadinejad. Yazdi does not like Western journalists, but one of his aide’s, Hojestaleslam Gharavian, spoke to me on his behalf. We met in an office on a nondescript residential backstreet of southern Qom.

Gharavian, a teacher of Islamic studies, wore black and white robes and a black turban. He explained that it was he who had first brought Ahmadinejad to Yazdi’s attention, and that it had come about by a quirk of destiny. The ayatollah had been in the habit of speaking to the university professors’ Basij organization once a week, but once, when he was unable to attend, and Gharavian had stood in for him. He had met and been impressed by Ahmadinejad, who was a prominent member of the group. Afterward, he told Ayatollah Yazdi about him, and introduced them. “What was it that impressed you?” I asked Gharavian. “I saw that he had a true Basij culture,” he said approvingly. “And that, like Imam Khomeini, he was especially resistant to foreign cultural influences.”