MONTREAL -- Retired Canadian-Iranian professor Homa Hoodfar has been released from an Iranian prison and is recovering with family in Oman, her friends and colleagues confirmed Monday, four months after her arrest that made headlines around the world.

Last March, shortly before she was to return to Canada after a trip to Iran, Hoodfar, 65, was detained and then released on bail but kept under house arrest. She was re-arrested and held in Tehran's Evin prison since June 6.

The exact reasons for her detention were never made public, but her family and colleagues have indicated she ran afoul of Iranian authorities due to her research on homosexuality and women's sexuality in the context of Muslim countries.

Until recently, Hoodfar taught anthropology and sociology at Montreal's Concordia University, where colleagues told a news conference they were overjoyed with her release.

Margie Mendell, a Concordia professor and close friend, said Hoodfar's niece Amanda Ghahremani was on hand to meet her in Oman -- the first stop on her journey home.

"She's very frail, she looks extremely thin ... and very worn," Mendell said of a report she received. "I suspect that she's not in good health, but she's free ... and she's out of Iran and she will get medical care and her medication."

Hoodfar suffers from a serious neurological condition and her family had said requests for a check-up by an independent specialist doctor while jailed were ignored.

The state-run Oman News Agency published pictures of Hoodfar arriving in Muscat, the Omani capital, on an air force jet and being greeted by Ghahremani. It quoted Hoodfar as saying she would spend a few days in Muscat before returning to Canada.

"I'm really grateful to his majesty, Sultan Qaboos, for making this happen ... after so many months, so many days in prison," a soft-spoken Hoodfar told Omani state television.

Oman, a Gulf Arab country on the southeastern tip of the Arabian Peninsula, is a U.S. ally and has been ruled by Sultan Qaboos bin Said since 1970. It has served as a mediator between Iran and the West on previous occasions.

Marc Lafrance, her former colleague in Concordia's anthropology and sociology department, said Hoodfar's family was grateful for the help from federal authorities.

Canada has not had an embassy in Iran since 2012, when its then-Conservative-led government cut diplomatic ties over Tehran's contested nuclear program and other issues.

Prime Minister Justin Trudeau said in a statement that the Canadian government has been "actively" working for her release.

Iran does not recognize dual nationalities, meaning those detained cannot receive consular assistance.

"In the absence of diplomatic representation of its own in Iran, Canada worked closely with others who were instrumental in helping secure Dr. Hoodfar's release -- most notably Oman, Italy and Switzerland," Trudeau said, thanking them for their support.

The prime minister also recognized "the co-operation of those Iranian authorities" who facilitated Hoodfar's release and repatriation.

Lafrance said he exchanged emails with her during her house arrest.

He said Hoodfar would be interrogated for up to nine hours and sent home with "homework."

Hoodfar was told to write essays on her research and political leanings, her colleagues said.

"The authorities were interested on homosexuality in the Muslim context; about sexual diversity in the Muslim context," Lafrance said. "Those subjects were part of her research."

Mendell, Lafrance and a few other Concordia professors were part of a small group working behind the scenes to secure Hoodfar's release. They would try to keep her story alive in the media, write press releases and solicit and edit opinion pieces from academics around the world for publication.

Foreign Affairs Minister Stephane Dion said in an interview that the Canadian government's engagement with Iran was "key" to secure her release.

"Engagement helps," Dion said. "Isolation would not have helped under these circumstances."

Iran's state-run news agency IRNA reported that Hoodfar had been freed from prison on humanitarian grounds and flown out of the country.

Hoodfar's supporters had pressed diplomats to discuss her case during the recent United Nations General Assembly in New York. Foreign Affairs Minister Stephane Dion met with his Iranian counterpart Mohammad Javad Zarif on the sidelines of the meeting last Wednesday.

In recent weeks, Hoodfar's supporters described her health as deteriorating while she was in solitary confinement, saying she was "barely able to walk or talk."

--With files from The Associated Press