A U.S. war resister who has been in Toronto for two years says the federal government has ordered him to leave the country.

Dean Walcott says Immigration officials have said he must leave Canada by Jan. 6 or face deportation.

He had applied to remain in the country on humanitarian and compassionate grounds but was denied.

Officials ruled he would not face undue risk by going back to the U.S.

Walcott, a former U.S. marine, arrived in Canada in 2006. He had been deployed to Iraq twice. Between the two deployments, he spent time stationed at a U.S military hospital in Germany.

In a press release, Walcott said he is "disappointed in the decision in light of the fact that Prime Minister [Stephen] Harper said himself during the election campaign that the Iraq war was absolutely an error."

Harper supported the U.S.-led mission in Iraq in 2003, when he was leader of the now defunct Canadian Alliance. During the English-language leaders' debate in the 2008 federal election campaign, he said that he felt the war was a mistake.

With files from the Canadian Press