DUBAI (Reuters) - President Mahmoud Ahmadinejad accused Iran's judiciary of unconstitutional conduct on Monday for barring him from a visit to Evin prison where a top aide is jailed, a row that provided another sign of his waning power in his final year in office.
Ali Akbar Javanfekr, Ahmadinejad's press adviser and head of the state news agency IRNA, was sent to Evin in September to serve a six-month sentence for publishing an article deemed offensive to public decency.
He was also convicted of insulting Supreme Leader Ayatollah Ali Khamenei, Iran's highest authority, on his personal website, though it is unclear how or when this happened.
Ahmadinejad's influence within the factionalized power structure has weakened since a clash with Khamenei in 2011 over the supreme clerical leader's reinstatement of Intelligence Minister Heydar Moslehi, whom Ahmadinejad had sacked.
The president's request to the judiciary to visit Evin, made public this month, was seen by Iranian media and commentators as linked to Javanfekr's detention, although there has been no official confirmation that this was the case.
The judiciary rejected the request on Sunday, saying it was not in Iran's best interests as it faces an economic crisis. Ahmadinejad's opponents in parliament blame the crisis as much on mismanagement by his administration as on Western sanctions.
"We must pay attention to major issues," prosecutor general Gholam-Hossein Mohseni-Ejei said on Sunday, according to the Mehr news agency. "Visiting a prison in these circumstances is a minor issue."
"If we have in mind the best interests of the nation, a (prison) visit in these circumstances is not appropriate."
In a letter to judiciary chief Sadeq Larijani published by Iranian media on Monday, Ahmadinejad said the ruling against Javanfekr was "unjust," adding he wanted to visit Evin to report to Khamenei and the country on how "the nation's rights are being preserved."
"I have to remind you that in the constitution, there is nothing that requires asking permission or agreement of the judiciary when it comes to exercising the president's legal duties," Ahmadinejad wrote, according to the Iranian Students' News Agency.
"When you easily accuse the president, who is the nation's representative ... Can one imagine judicial security for normal citizens who have no particular support except from God?"
Khamenei appoints the head of the judiciary and wields ultimate power but generally stays above the fray of rough-and-tumble politics in the Islamic Republic.
On Monday, Khamenei's representative to the powerful Islamic Revolutionary Guard Corps was quoted as saying that he regretted his past support for Ahmadinejad.
"We did not have the prescience to know what was going on in Mr Ahmadinejad's mind and what he wanted to do in the future," Ali Saeedi Shahroudi told the Etemaad newspaper. "The slogans he uses now are different from the slogans he used in the past."
Ahmadinejad, a conservative hardliner, is coming to the end of his second term and will not be allowed to run in the June 2013 presidential election.
(Reporting by Yeganeh Torbati and Zahra Hosseinian; Editing by Mark Heinrich)