DUBAI (Reuters) - Iran said on Monday it had freed a Canadian-Iranian academic detained since June, releasing her just a week after the two countries began talks on a potential restoration of diplomatic relations broken in 2012.

Homa Hoodfar, 65, is a teacher at Concordia University in Montreal, Canada, and an expert on gender and Islam.

“Homa Hoodfar, the retired professor of Canadian universities, who had been detained in Iran based on some accusations, was released this afternoon for humanitarian reasons including illness,” Iranian Foreign Ministry spokesman Bahram Qasemi said.

He said Hoodfar had left the Islamic Republic and was traveling to Canada via the Gulf Arab state of Oman.

Oman confirmed it had arranged for a royal air force plane to fly Hoodfar to Muscat on her way to Canada, heeding a Canadian request to help in her release, state news agency ONA quoted a Foreign Ministry statement as saying.

Iran’s Revolutionary Guards have arrested at least seven dual-nationality citizens or expatriates visiting the country over the past year, the highest such number in acknowledged detention in recent years.

Oman, an ally of the West that also maintains good relations with Tehran, has previously helped facilitate prisoner exchanges between Iran and the United States.

Canadian Prime Minister Justin Trudeau said that while his country had sought Hoodfar’s release “at the highest levels,” it had worked with Oman, Italy and Switzerland since Ottawa has no embassy in Iran.

“I would also like to recognize the cooperation of those Iranian authorities who facilitated her release and repatriation,” he said in a statement. “They understand that cases like these impede more productive relations.”

Iranian Foreign Minister Mohammad Javad Zarif and Canadian counterpart Stephane Dion met last week during the annual U.N. General Assembly in New York for the first time since Tehran and Ottawa severed relations four years ago.

Canada shut its embassy in Iran and expelled all Iranian diplomats in Canada in 2012 after accusing Tehran of posing the biggest threat to global security, mainly over its nuclear program and military assistance to Syrian President Bashar al-Assad.

Since striking a deal with world powers last year under which it curbed its nuclear activity in exchange for sanctions relief, pragmatist Iranian President Hassan Rouhani has sought to mend ties with the West to improve the economy.

However, the potential diplomatic opening to longtime Western adversaries has been resisted by powerful hardliners in the Iranian leadership, including the Revolutionary Guards.