The “end of times” was a constant theme for Mahmoud Ahmadinejad, who often said that setting the stage for the second coming of the Mahdi - a messianic figure in Twelver Shiism - was the ultimate spiritual aim of his eight-year presidency. While the tightened sociocultural atmosphere of his reign ensured that this belief was never publicly ridiculed, his critics often joked behind closed doors that the 57-year-old hardliner had come dangerously close to achieving his goal.

With the economy in shambles and state coffers hemorrhaging cash, voices from both inside Iran’s power structure and the public are demanding that Ahmadinejad be held culpable for the opulent spending and obstinate political maneuvering that eventually caused him to lock horns with the regime’s most influential players, including supreme leader Ayatollah Ali Khamenei. But as the new moderate president Hassan Rouhani grows increasingly critical of his predecessor against the background of an opaque criminal trial, Ahmadinejad’s case is also raising new questions regarding the rule of law and the accountability of Iran’s political leaders.

The latest blow to Ahmadinejad’s reputation came last week in the shape of Rouhani’s televised address marking his first 100 working days in office. Fresh from securing a nuclear deal with western powers at the Geneva talks, Rouhani turned his attention to the economy, blaming some of the most pressing domestic problems - from stagflation and currency devaluation to recession and a growing reliance on imports - on the actions of the Ahmadinejad government.

Although he operated with some $600bn in oil revenues during his reign, Ahmadinejad’s presidency left the country with an estimated debt of $67 bn, Rouhani said. While sanctions are partially to blame for the government’s fiscal problems, Ahmadinejad’s populist subsidy handouts and affordable housing schemes also contributed by flooding the economy with cash and causing an inflation record of above 40%, according to Rouhani. For many Iranians sitting in front of their TV sets, such candid descriptions of mismanagement raised new ire against Ahmadinejad, whose popularity plummeted during his last years in office.

“He belongs in Evin [prison] for what he did to this country,” said Romtin, 29, as he watched Rouhani’s address in his Tehran home. “It’s funny that someone can say this on national TV and there is no reaction. It’s like there’s a silent agreement that whoever is in power can get away with anything.”

Despite voters’ disenchantment with the political developments of the past eight years, the current efforts to prosecute Ahmadinejad in criminal court are not necessarily welcomed as signs of a return to order.

“On the one hand, I’m aware of the fraud he perpetrated against us and wish him to be prosecuted, for any reason,” says Mojgan, 40, a housewife. But, she adds that if Ahmadinejad was to be tried, it should be on the basis of financial corruption. “The image of a person who was once the president of this country should not be besmirched.”

Rather than targeting his financial mismanagement, the main charges lodged against the former president are of a bureaucratic nature. Ahmadinejad is accused of failing to set the structure of the National Iranian Oil Company, delaying the operation of the ministry of youth and sports, and failing to set a budget for the country’s metro system. However, reformist newspapers have noted that that the complaints against Ahmadinejad are not limited to these three violations. His case features nine different plaintiffs, according to members of the Iranian parliament’s government oversight committee, and the charges range from causing “high mortality rates on the nation’s highways” to spending lavishly during his last trip to the UN general assembly in New York City last year.

Yet another charge involves parliament speaker Ali Larijani, whom Ahmadinejad attempted to discredit after Larijani led impeachment proceedings against him last winter. During his appearance in parliament, Ahmedinejad played a controversial video tape in which Larijani appeared to solicit a bribe from Saeed Mortazavi, then the head of the social welfare organization. That afternoon, the parliament speaker’s brother, Fazel Larijani, filed a judicial complaint against Ahmadinejad and Mortazavi for the “dissemination of falsehoods,” and said that he would pursue the case until final redress.

Ahmadinejad and his supporters have questioned both the constitutionality and fairness of the accusations, claiming the case was an “insult to the feelings of millions of Iranians.” His refusal to attend the start of the trial in Tehran 26 November did not surprise local observers, who noted that the maverick politician may have dodged the public appearance to avoid public embarrassment.

“If Ahmadinejad was certain that his appearance in court would lead to controversy and the unrest of social forces, he would have appeared,” a Tehran political analyst told Tehran Bureau. “The truth is that he doesn’t have his past popularity. People are forgetting him.”

Though Ahmadinejad has lost many of his former supporters, some remain concerned that political obscurity may make him a convenient scapegoat for those still at the levers of power. Delving into the available court documents related to the case, local newspapers have noted that several of the complaints have been signed by private individuals with no public service record, making it difficult to determine exactly who stands behind the prosecutions.

If the legal proceedings against him continue, Ahmadinejad would become the first president of the Islamic republic to stand trial for actions he took while in office. However, there are indications that not everyone in the establishment is interested in seeing this happen. Gathering on the steps of the central Tehran courthouse on the day of the trial, a small core of Ahmadinejad supporters recited Al Yassin, a Shia prayer calling on the Mahdi to return. It was reportedly a pitiful showing compared to the crowds he used to conjure, but the notoriously unpredictable former president may still have a political ace up his sleeve.

During the Ashura mourning ceremonies two weeks ago, Ahmadinejad made an appearance at the house of Khamenei, who has in past months made efforts to calm the divided political scene by calling on the judiciary to halt related prosecutions against one of Ahmadinejad’s former deputies. In public photos from the event, Ahmadinejad was once again seated at the supreme leader’s right-hand side.

The Tehran Bureau is an independent media organisation, hosted by the Guardian. Contact us @tehranbureau. This article was originally published without a byline