Ali Akbar Javanfekr, Ahmadinejad’s press advisor and head of the country’s 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 Iranian Supreme Leader Ayatollah Ali Khamenei on his personal website, though it is unclear how or when this happened.
Ahmadinejad’s request 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 this was the case.
The judiciary turned down the request on Sunday, saying it was not in the best interests of the country as it faces an economic crisis which parliamentary rivals blame as much on mismanagement by Ahmadinejad’s administration as 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,” prosecutor general added.
Ahmadinejad has seen his influence wane within Iran’s factionalized political structure following a public spat with Khamenei in 2011.
The feud between the Iran’s elected and unelected leaders erupted in public last year after Khamenei, who holds ultimate power, reinstated intelligence minister Heydar Moslehi, who Ahmadinejad had sacked.
Conservative rivals of Ahmadinejad in parliament say his administration has mishandled a currency crisis and other economic fallout from the sanctions levied against Iran’s disputed nuclear program.
According to Iranian law Ahmadinejad is not allowed to run for a third term in the June 2013 presidential elections.