An Iranian foreign ministry spokesman said Hoodfar, 65, had been released on "humanitarian reasons, including illness."

Hoodfar, a retired sociology and anthropology professor from Montreal's Concordia University, was charged with "dabbling in feminism" and sent to Tehran's notorious Evin prison. A court found Hoodfar guilty, imposed a sentence of several years, and ordered her to be deported, a source told The Huffington Post Canada.

OTTAWA — Iranian-Canadian professor Homa Hoodfar has been released from an Iranian prison where she had been languishing since June.

Iranian-Canadian professor Homa Hoodfar speaks to the media in Muscat airport, Oman on Sept. 26, 2016. (Photo: Oman News Agency via AP)

She landed on Monday in Oman, a country that had helped secure her release. She was to be greeted by Canada's ambassador to Saudi Arabia and undergo a medical exam before boarding another flight to London where she is expected to meet family members.

In a statement, Prime Minister Justin Trudeau said Canadians are relieved that Hoodfar was released from jail and would soon be reunited with her family, friends and colleagues.

"The Government of Canada has been actively and constructively engaged at the highest levels in Dr. Hoodfar's case — since her ordeal began — working for her release and return to Canada," he said.

"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. I would like to extend our sincerest appreciation for their support.

"The Government of Canada has been actively and constructively engaged at the highest levels in Dr. Hoodfar's case — since her ordeal began — working for her release and return to Canada." — Prime Minister Justin Trudeau

"I would also like to recognize the cooperation of those Iranian authorities who facilitated her release and repatriation. They understand that cases like these impede more productive relations."

A few weeks ago, the Canadian government stepped up its efforts to free Hoodfar after reports that her health was deteriorating. Her niece told CBC News that she had been hospitalized in jail and could barely talk. Hoodfar suffers from a neurological disease called myasthenia gravis.

Canada pleaded with the Omanis to help, the source told HuffPost, and also worked with Italy — which has been providing consular assistance to Canadians in Tehran ever since Canada closed its embassy in 2012.

Foreign Affairs Minister Stéphane Dion also met with the Iranian foreign minister on the margins of the United Nations' general assembly last week to push for Hoodfar's release.

'Accused of dabbling in feminism'

Hoodfar reportedly "scared" the Revolutionary Guard when she interviewed Iranian women on the street, and used religious text to argue that Islam promoted women's equality and empowerment.

"She was accused of dabbling in feminism and being part of a global network of feminists who want to change Iranian society, and being a collaborator with foreign governments," the source said.

Her family, who said Hoodfar was on a personal research trip, described the charges as trumped up.