Updated

A top adviser to Iran's president on human rights said that the government "failed" to help a U.S. permanent resident imprisoned over spying allegations that she herself invited to the country for a summit.

In a wide-ranging interview with The Associated Press, Shahindokht Molaverdi acknowledged the limits a civilian government faces when challenging the actions of the judiciary in the Islamic Republic, especially when dealing with cases involving the imprisonment of foreigners and activists.

She cited the case of Nizar Zakka, a Lebanese-born internet freedom advocate living in the U.S., who she invited to a conference in September 2015. The hard-line Revolutionary Guard later arrested Zakka on his way to the airport, and he was later sentenced to 10 years in prison on spying charges in a closed-door trial before a Revolutionary Court.

"This is in no way approved by the government," Molaverdi said. "We did all we could to stop this from happening, but we are seeing that we have failed to make a significant impact."

Molaverdi is an outspoken official within the government of elected President Hassan Rouhani, a relatively moderate cleric within Iran's Shiite theocracy. In Rouhani's first term, she served as his vice president for women and family affairs, and in his second term become his special assistant on citizenship rights.

Political analysts within Iran saw Molaverdi's reassignment as Rouhani responding to hard-liners' criticism of her comments on women's rights and other issues.

She's condemned police overreach in dealing with women loosely wearing their mandatory headscarves and demanded access for women to sporting events. She gave an interview in 2016 in which she said all the men in a single, unnamed village in Iran's eastern Sistan and Baluchistan province had been executed for drug offenses.

Molaverdi said she has friends working on women's rights issues who have been arrested by Iranian security forces. She blamed a "complete miscoordination" between Iran's civilian government and its judiciary, which like its state media and security forces is believed to be controlled by hard-liners.

"Actions by one branch can ignore or neutralize efforts by another branch," she said. "This is an art and a very delicate job and sometimes the situation gets out of our hands, but anyway the goal of all of us is to stop this from happening and to minimize this."

Iran's executive branch under both hard-liners and more-moderate presidents has had difficulty freeing prisoners, especially foreigners. That can happen both from the hard-line judiciary exerting its power and disputes between Iran's Intelligence Ministry, answerable to the president, and the county's paramilitary Revolutionary Guard, answerable only the supreme leader.

"The executive branch is clearly aware of the limitations it operates under and will pick its battles with the judiciary carefully," said Ellie Geranmayeh, deputy director of the Middle East program at the European Council on Foreign Relations.

Zakka's appears to be one of the cases where it got out of hand.

Zakka lives in Washington and holds permanent resident status in the U.S. He leads the Arab ICT Organization, or IJMA3, an industry consortium from 13 countries that advocates for information technology in the region.

It's unclear what prompted Iranian authorities to detain Zakka, though Iran in the past has used prisoners with Western ties as bargaining chips in negotiations.

The AP reported in May 2016 that Zakka's IJMA3 organization had received at least $730,000 in contracts and grants since 2009 from both the State Department and USAID, the lead American government agency fighting poverty and promoting democracy across the world.

Zakka's supporters say he traveled to Iran "with the knowledge and approval" of the State Department, something the AP has been unable to confirm.

Molaverdi acknowledged being the Iranian official who granted him permission to enter the country and remembered eating dinner with him at a conference and posing for a group photograph.

"I was later informed that he didn't go back to his country and on his way to the airport he had been arrested," she said. "He's still in prison and a heavy sentence has been issued against him."

She added: "Such incidents definitely harm how Iran's domestic security is viewed from the outside for investment, although in reality it is not like that, but a false image is presented of our country."

Jason Poblete, a Washington-based lawyer representing Zakka, said that while he appreciated Molaverdi's comments, they didn't change the fact "Nizar was kidnapped and thrown in jail, not treated as a guest."

"While a welcome sign that you seem to agree with Nizar that he was falsely accused, Nizar is going on three years in Evin" prison, Poblete told the AP. "This injustice has caused great and some unspeakable stresses on Nizar and his family. There are humanitarian and other grounds for Nizar's release and all the parties in interest — they know who they are — need to work expeditiously to right this injustice."

Molaverdi acknowledged a recent spate of arrests of lawyers working on human rights issues, something criticized by Amnesty International as an "intensifying crackdown on civil society." She also said Rouhani's government was working to help release imprisoned students and so-called "starred" students — those blocked by security agencies from attending classes.

Asked about nationwide demonstrations in December and January sparked by Iran's economic woes that saw thousands arrested, Molaverdi stressed there was a difference between protests and "rioting."

Still, Molaverdi said change was possible and even necessary in Iran some 40 years after its Islamic Revolution.

"If we rethink our experiences, definitely, we'll come to the conclusion that we have other options available that are more effective," she said.

___

Associated Press television producer Mehdi Fattahi in Tehran, Iran, contributed to this report.

___

Follow Jon Gambrell on Twitter at https://twitter.com/jongambrellAP . His work can be found at http://apne.ws/2galNpz .