A U.S. army deserter and his family were granted a last-minute stay of deportation Monday by a Federal Court judge while the court decides whether to hear their appeal.

Jeremy Hinzman, his wife and two children were ordered to leave Canada by Tuesday or face forcible deportation to the United States, where the soldier faces prosecution for fleeing to Canada in 2004 rather than deploying with his army unit to Iraq.

The judge's decision will allow the family to remain in Toronto while the court decides whether to review a decision by Citizenship and Immigration officials not to let the Hinzmans remain in Canada on humanitarian and compassionate grounds. They are also trying to appeal their pre-removal risk assessment.

"We're elated. We weren't expecting this much, so it's a nice surprise," said Hinzman who didn't expect the stay to be granted."[But] we're not out of the woods at all. We just have a stay of removal."

Supporters of the family staged a demonstration outside the Federal Court in downtown Toronto while waiting for the judge to hand down the decision.

"Based on the evidence and submissions before me, I am satisfied that the applicants would suffer irreparable harm if a stay were not granted pending determination of their leave application," Justice Richard Mosley said in his three-page endorsement.

Earlier, Hinzman's lawyer, Alyssa Manning, argued that deserters who have been publicly critical of the U.S.-led invasion of Iraq have received harsher punishment after returning to the U.S.

Last month, U.S. deserter Robin Long was sentenced to 15 months in prison after lawyers mentioned a media interview he had given in Canada before he was deported in July, Manning told the court.

As one of the first deserters to seek refuge in Canada rather than fight in Iraq, Hinzman's case has been even more public.

"He is the person associated with objections to the war in Iraq," Manning told the court.

Crown lawyer Stephen Gold called it "speculation and surmise" that criticizing the U.S. military in public has led to harsher sentences for deserters.

"It is not really for us to pass judgment on a military code in a foreign country," Gold said.

Hinzman's claim for refugee status was rejected by the Immigration and Refugee Board in 2005. An appeal to the Federal Court of Appeal also failed, with the court ruling that he wouldn't face any serious punishment if he returned to the U.S.

The Supreme Court of Canada refused to hear his case.

After the judge's decision, Lee Zaslofsky, co-ordinator of the War Resisters Support Campaign said, "we are very happy that the court has granted this stay of deportation."

"Jeremy and his family will be allowed to remain in Canada at least until the court decides whether to hear his appeal."

"This is good news for Jeremy, his family and their many supporters across Canada," said Michelle Robidoux, an organizer with the campaign. "But we continue to call on Immigration Minister Diane Finley to implement the motion adopted by the House of Commons on June 3, calling on the government to cease deporting Iraq war resisters."

With files from the Canadian Press