A British transgender woman who was temporarily held in a men’s detention facility in Ontario this week after being detained by border officials over an immigration issue will be flown home to the U.K.tomorrow, her partner says.

Avery Edison, 25, is expected to board a flight Thursday, four days after she was detained by border officials at Toronto’s Pearson International Airport.

Edison’s partner Romy Sugden tweeted Wednesday afternoon that Edison will be flown home to the U.K. Thursday with “no exclusionary notice that would prevent her from visiting Canada in the future” following an immigration hearing.

Sugden later told CTV News Channel that the ordeal “took its toll” on Edison, “but she stayed strong throughout.”

According to her own tweets, Edison, a British comedian, had intended to stay in Toronto for only a short visit, but was denied entry after officials found that she had overstayed her student visa the last time she visited the country.

Despite carrying a passport that identifies her as female, Edison was later sent by border officials to Maplehurst Correctional Institute, a male-only detention centre in Milton, Ont., to await an immigration hearing.

Edison said she was told by border staff that the reason she was being sent to the male facility is because she has male genitalia.

“Initial interviewing officer is telling another about my depression, keeps switching he/she. MY PASSPORT IS FEMALE,” she tweeted.

“Please keep Toronto Airport customs/immigration officials in your thoughts, as this is apparently their first time meeting a trans person,” she also tweeted. 

Sugden said she was “completely, completely horrified” by what happened to her partner.

“I was under the impression that Ontario had quite progressive LGBT laws, particularly when it comes to trans human rights,” she said Wednesday. “That is clearly not the case.”

Edison’s transfer to a male-only facility treatment ignited a firestorm of controversy over Twitter and other social media sites.  

Edison wrote that she was feared she would be a potential target for attacks from other inmates in the men-only facility.

A shift supervisor at Maplehurst confirmed late Tuesday that Edison was transferred to Vanier Centre, a women-only correctional facility.

Sugden said pressure from Edison’s Twitter followers, as well as media coverage of the case, helped.

A spokesperson from the Ministry of Safety and Correctional Services issued a statement Tuesday, saying: “Classification recommendations and decisions are made on a case-by-case basis and are based on factual information and objective criteria.” 

Canada Border Services is not commenting on the matter, citing privacy concerns, but said in an email to The Canadian Press Tuesday that it asks the province to avoid placing those detained on immigration issues with criminal inmates.

"Ultimately, it is the decision of the provincial service provider that determines in which facility the individual will be detained," spokesperson Anna Pape said.

With files from The Canadian Press