HALIFAX -- A Federal Court judge has set aside a decision to refer the case of Abdoul Abdi to a deportation hearing, saying Ottawa "blatantly" ignored the Somali child refugee's charter rights and did not consider international law.

In a written decision dated July 13, Justice Ann Marie McDonald said a delegate of the public safety minister failed to consider the Charter of Rights and Freedoms and international law in arriving at her decision, despite being statutorily mandated to render a decision consistent with the charter.

"Most blatantly, the (delegate's) decision discloses no indication that the (delegate) even considered the charter values," said McDonald, who does not name the delegate in her decision.

"In fact, the charter is not mentioned anywhere in the (delegate's) cover letter outlining the issues she considered or in the body of her decision. This is so despite Mr. Abdi's extensive submissions on the charter."

Still, the threat of deportation remains for Abdi, who was never granted Canadian citizenship while growing up in foster care in Nova Scotia.

The Canada Border Services Agency had detained the 24-year-old man after he served about five years in prison for multiple offences, including aggravated assault.

Abdi, who has never lived in Somalia and has no ties to the country, had sought a judicial review of the federal government's decision to refer his case to a deportation hearing. His lawyer Benjamin Perryman argued in Federal Court in Halifax that the decision was unreasonable, unfair and contrary to the charter and international law.

McDonald noted the delegate is also required to weigh the statutory objectives of the Immigration and Refugee Protection Act with the values of the charter, and that her decision was unreasonable and not "justified, transparent and intelligible."

It goes on to highlight the unique facts of Abdi's case, including that his aunt had unsuccessfully attempted to apply for citizenship for him in 2005, but was stopped by the provincial Department of Community Services on the basis that as a ward of the state, only it could apply for citizenship.

"These factors may be relevant considerations with respect to a (section 15) charter value of non-discrimination in the (delegate's) referral decision. But they were not considered," the decision said.

McDonald set aside the decision to refer the matter to a deportation, and sent the case back for "redetermination" by a different delegate of the public safety minister.

Public Safety Canada did not immediately return a request for comment Monday.

Perryman said his client is happy with the decision, but has found the process over the past two years "emotionally distressing and extremely stressful."

"He says he's trying to work a lot and stay productive, reintegrate into Canadian society, and help his family, but he said to me, 'I'm tired of living life on this roller coaster and I'm ready to live life in peace'," said Perryman.

The lawyer noted this is the second time the Federal Court has overturned a decision to refer the case to a deportation hearing. In October 2017, the court concluded that the decision-maker relied on protected youth records, but his case was again referred to a deportation hearing in a January 2018 redetermination decision.

Perryman said there remains uncertainty about what will happen next, and it's possible the matter could be referred to a deportation hearing a third time. He said he hopes Ottawa will instead issue a warning letter, which would pause deportation proceedings so long as Abdi maintains good behaviour.

"Mr. Abdi should not have to go to court a third time for this government to do the right thing," said Perryman. "It's time for the ministerial leadership to end the proceedings against him and to ensure that children in state care become citizens."

Perryman has said a deportation hearing would inevitably lead to a deportation order given the circumstances of Abdi's case.

Abdi, who was born in Saudi Arabia in 1993, lost his Somalian mother in a refugee camp when he was four and came to Canada with his sister and aunts two years later.

He was taken into provincial care shortly after arriving in Canada.

Abdi was moved between foster homes 31 times. He lost his native language and developed behavioural problems that advocates say were not adequately treated. They say those issues led to problems with the justice system and his non-citizenship put him at risk of deportation.

His case has prompted supporters to call on the Nova Scotia government to intervene on his behalf, and sparked protests at events with federal leaders, including a town hall earlier this year with Prime Minister Justin Trudeau in Lower Sackville, N.S.