The lawyer for a Canadian man stranded in Sudan said his client was 'jumping through hoops' after learning Ottawa had been ordered by a federal judge to bring him home.

Abousfian Abdelrazik, of Montreal, has been stuck in Khartoum since 2003 when he returned to his native country.

He was arrested on suspicion of having links to terrorism, but was released and never charged. However, the federal government has refused to let him come home.

On Thursday, Federal Court Justice Russel Zinn ruled Abdelrazik's constitutional rights have been violated and Ottawa must bring him home within 30 days.

His lawyer Yavar Hameed told CTV's Canada AM the ruling was a "profound development" in the case.

"He was ecstatic yesterday," Hameed said from Ottawa.

"He told me he felt like jumping for joy. But all of that has to be contextualized within his somewhat guarded optimism that he's been fighting this struggle for six years, so until he sets foot on Canadian soil he's not going to fully believe the impact of this decision."

In his ruling, Zinn said travel arrangements must be made within 15 days, and that he expects Abdelrazik to be home within 30 days. Zinn said he expects Abdelrazik to attend a court date scheduled for July 7.

He also wants to be kept update on the government's progress on bringing him home.

However, the federal government may still decide to appeal the ruling.

"The discretion really lies with our minister of foreign affairs," Hameed said. "He can simply sign a document and Mr. Abdelrazik can come home tomorrow and in fact within 30 days, that's what's expected of this government."

Abdelrazik, a Canadian with family in Montreal, has been trapped in Sudan for six years after he returned to visit his ailing mother.

"He lives by himself with strangers while his immediate family, his young children, are in Montreal," the judge wrote.

"He is as much a victim of international terrorism as the innocent persons whose lives have been taken by recent barbaric acts of terrorists."

Justice Minister Rob Nicholson told the House of Commons on Thursday that his department was reviewing the decision and made no indication to suggest the government was moving to bring Abdelrazik to Canada.

"While in Sudan in 2003, Abdelrazik was arrested on suspected terrorism ties, but was released without being charged and was eventually cleared by the RCMP and CSIS of any wrongdoing.

However, Abdelrazik's Canadian passport was seized and never returned, and he was not allowed to return home.

He eventually sought shelter at the Canadian embassy in Khartoum, where he has lived for about a year.

Embassy staff have been providing him with food and he is sleeping on a cot in the building's gym.