"His arrest is clearly a violation of the constitution...that confirms the need for fundamental reforms within the judiciary," the former president said in a statement.

Still, Mashaie’s tenure in office was cut short and he was forced to step down by Supreme Leader Ayatollah Ali Khamenei after saying that Iran was a friend of the US and Israeli people.

His detention comes after video uploaded on social media showed Mashaie demonstrating on Thursday outside the British embassy to protest against the incarceration of another of Ahmadinejad's former vice presidents.

Hamid Baghaie was arrested on Tuesday to begin serving a 15-year jail sentence that was issued in December when a court found him guilty of embezzlement and illegal business transactions.

ISNA news agency cited Mashaie's lawyer, Mehran Abdollapour, as saying his client was arrested in the evening as he was leaving Baghaie's house.

British embassy

"My client was probably arrested for having recently burnt a copy of Mr Baghaie's verdict outside the British embassy," the lawyer said.

Ahmadinejad and Baghaie both hoped to stand in the May 2017 presidential election, but the conservative-dominated Guardians Council rejected their candidacy.

The ex-president has become increasingly isolated after challenging Khamenei and his powerful allies, including the judiciary, Radio Free Europe reported on its website. Ahmadinejad last year accused the judiciary of "dictatorship".

Mashaie, who was the chief-of-staff of Iran's former hardline two-term president, was barred from standing in the 2013 presidential election as well by the Guardians Council.