(AP) TEHRAN, Iran — An Iranian court sentenced a close ally of former hardline president Mahmoud Ahmadinejad to six-and-a-half years in prison, semi-official ISNA news agency reported Wednesday.

The report quoted Tehran Justice Department chief Gholamhossein Esmaili as saying Esfandiar Rahim Mashaei was sentenced to five years for plotting and conspiring to commit crimes against national security, one year for propaganda against the Islamic Republic system and six months for insulting officials.

The sentencing can be appealed within 20 days.

Esmaili also said there are other cases against Mashaei in court and they will be announced after the prosecution process.

In March, Mashaei was detained after he burnt a copy of a court verdict sentencing Hamid Baghaei, another Ahmadinejad ally, to 15 years for misuse of public funds when he was Ahmadinejad’s vice president.

During Baghaei’s trial, Ahmadinejad repeatedly appeared outside the court criticizing many officials, including the head of the judiciary, Ayatollah Sadegh Amoli Larijani.

Ahmadinejad repeatedly criticized the Judiciary chief and accused him as an oppressor, accusing his allies over misusing public funds, and called the body “ruthless” and “oppressive.”

Several of Ahmadinejad’s allies are in jail over similar charges.

In February, the former hardline president asked the country’s Supreme Leader Ayatollah Ali Khamanei to immediately change the country’s judiciary chief and for free presidential and parliamentary elections.

Later in August, he also asked President Hassan Rouhani to resign and said Iranians do not trust him.

Ahmadinejad, who called himself “Servant of the nation,” has brought attention to himself since he was barred from running in 2017 presidential election elections which Hassan Rouhani won.

The former president is not popular among his former allies now. Many of them condemned his recent measures in the county’s politics.

While president, he famously questioned the Holocaust and claimed there were no gays or lesbians in Iran.