A transgender woman from the U.K. who was detained at a men’s jail in Toronto has settled a human rights complaint against the Ontario government.

“The Ontario Ministry of Community Safety and Correctional Services has acknowledged the concerns raised in the complaint and implemented a new policy for the transgender people in Ontario,” said Jonathan Schachter, after a mediation session at the Ontario Human Rights Tribunal Thursday.

“Avery is delighted that, as a result of her complaint, Ontario has made meaningful and important changes on the admission and placement of trans people in correctional facilities.”

Edison, who is legally identified as a woman in her British ID and passport, was stopped by Canada Border Services Agency at Pearson airport in February 2014 for overstaying in the country during a previous visit.

She was held at Milton’s Maplehurst Correctional Complex for 20 hours before she was moved to the nearby Vanier Centre for Women after her ordeal was widely reported by the media. She was deported from Canada two days later.

In July, she filed a human rights complaint claiming she was discriminated and mistreated by the Canadian officials because of her gender, touching off a public debate over the “misgendering and misplacement” of trans people in the Ontario jail system.

“At Maplehurst, in spite of Ms. Edison’s legal and self-identification as a woman, Ms. Edison was continually referred to as ‘he’ or ‘him’ or ‘sir,’ ” the complaint said.

Ontario correctional services had had a longstanding policy to assign pre-operative trans people to a detention facility based on their gender at birth.

In light of Edison’s high profile complaint among others, the province changed its policy in January and began placing inmates in institutions fitting to their self-identified gender or housing preference. Trans inmates now also have the option to be frisk-searched by a male or female guard.

A fundamental change also includes the way the inmates prefer to be addressed in terms of gender pronouns, both in verbal communication and written documents.

However, Edison’s complaint with the Canadian Human Rights Commission is still outstanding because the federal rights watchdog has so far refused to entertain the claim, saying the protection did not extend to Edison because she was not “lawfully present” in Canada.

Schachter refused to say if the legal settlement included any financial remedy for damages caused to his client. Edison could not be reached for comment.

With files from Donovan Vincent