In this Oct. 1, 2006 file photo, Army Sgt. Patrick Hart poses for a photo in Toronto. In 2006, Hart deserted the Army and lived as a "war resister" in Canada. Since then, he turned himself in, was convicted of desertion and served time in a military prison. (Harry Rosettani/AP)

— When Army Sgt. Patrick Hart decided a decade ago that he would not serve in the war in Iraq, he expected to follow the same path as thousands of American war resisters during the Vietnam era and take refuge across the border.

But after five years of wrangling with the Canadian immigration system, he came back to the United States — and ended up in a military prison.

The country that once welcomed war resisters has developed a much different reputation during the conflicts in Iraq and Afghanistan. Supporters say no U.S. soldier who has sought legal residence in Canada, either as a refugee or on humanitarian grounds, has been successful.

“Nobody’s won,” said Hart, a Buffalo native who, after exhausting his legal options, turned himself in, was court-martialed for desertion and was sentenced to two years in prison.

There are an estimated two dozen U.S. military members still waiting out their fate in Canada, and the resisters’ movement is seen as nearing a crossroads. With a national election three months away, supporters are hoping for a Liberal Party victory and a more sympathetic stance toward American military exiles, but they are also bracing for the possibility Conservative Prime Minister Stephen Harper will win reelection.

Liberal Party leader Justin Trudeau has not committed to letting resisters stay, but many are buoyed by his family history. It was his father, Pierre Trudeau, who, as prime minister during the Vietnam War, declared Canada should be “a refuge from militarism.”

“Why not do it again? It’s only a couple of dozen people,” said Michelle Robidoux, spokes­woman for the War Resisters Support Campaign in Toronto, which has been lobbying members of Parliament.

After a flurry between 2004 and 2006, it has been at least four years since any known residency requests have been filed, Robidoux said.

Besides Hart, at least three soldiers who were deported or left Canada have been sent to prison: Pfc. Kim Rivera, a mother of five, was sentenced in 2013 to 10 months; Spc. Clifford Cornell of Mountain Home, Ark., received a one-year term in 2009; and Pfc. Robin Long of Boise, Idaho, was sentenced in 2008 to 15 months.

Some deserters face court-martial, but the majority are discharged on less-than-honorable terms. Army officials said more than 20,000 soldiers have deserted since 2006.

Canada’s immigration laws have tightened since the Vietnam War, the support campaign said, giving U.S. soldiers few options other than to try for refugee status based on the fear of persecution if made to go home.

Government guidance issued to immigration officers in 2010 requires them to consult supervisors on U.S. military cases and spells out that desertion is a crime that may render those who have left the military criminally inadmissible to Canada.

“Military deserters from the United States are not genuine refugees under the internationally accepted meaning of the term,” Citizenship and Immigration Canada spokeswoman ­Nancy Caron said in an e-mailed statement. “These unfounded claims clog up our system for genuine refugees who are actually fleeing persecution.”