One of hundreds of people to hike north across the U.S.-Canada border in the wake of President Donald Trump stoking fears about deportation has lost a bid for refugee status, and his past criminal convictions played a role, court documents say.

Earlier this month, Federal Court Judge Glennys L. McVeigh ruled against the asylum claim of Abdirizak Abdullahi Mohamed.

Mohamed, 35, trekked into the province not far from the official border crossing in Emerson, Man., in early 2017. He said pronouncements from Trump that year influenced his decision to head to Canada and file a refugee claim.

The U.S. president had signed an executive order in January 2017 to temporarily ban refugee admissions and travel to the U.S. from Somalia and six other Muslim-majority countries.

At the time, Mohamed had been living in Minneapolis for about 16 years. The Minnesota city is home to one of the largest Somali populations in the U.S., and he alleges there were rumours floating around locally about the Trump administration revoking the status of Somalis.

One day after Trump's travel ban came a tweet from Prime Minister Justin Trudeau touting Canada's immigration system.

To those fleeing persecution, terror & war, Canadians will welcome you, regardless of your faith. Diversity is our strength <a href="https://twitter.com/hashtag/WelcomeToCanada?src=hash&ref_src=twsrc%5Etfw">#WelcomeToCanada</a> —@JustinTrudeau

That tweet was followed by another with a picture of Trudeau greeting a newly-arrived Syrian refugee child.

On April 10, 2017, Mohamed walked or was driven over the border into Canada. That same day a Canada Border Services Agency officer determined he was inadmissible "on grounds of serious criminality" under a section of the Immigration and Refugee Protection Act, court documents show.

So he sought a judicial stay of proceedings, with Winnipeg-based immigration lawyer Bashir Khan representing him in Federal Court.

Bashir Khan is a Winnipeg immigration and refugee lawyer. (Austin Grabish/CBC)

"Canada should protect him because of his ethnicity, because of who he is afraid of in Somalia, and that is the principle that should be applied in why we should be giving him humanitarian status and protection in this country," Khan said Wednesday.

Shot at 7

Born in Mogadishu, Somalia, in 1984, Mohamed and his family are members of the Madhiban, a "low caste" tribe that faces social and economic discrimination in Somalia.

Mohamed said due to their Madhiban roots his family was attacked during the Somali civil war. His sister was sexually assaulted and his father was killed in 1991, he says, because the family couldn't pay off a rebel group.

Mohamed said he was shot in the leg at the age of seven, according court documents, but he and some of his family fled to a Kenyan refugee camp.

It was in 1999 that his brother sponsored him to come to the U.S. In 2001, he and his family arrived in Minneapolis.

Soon thereafter, Mohamed said his brother left and his mother died. At the age of 18, with few supports, he began drinking and committing crimes to survive, court documents say.

His crimes span three or four years, beginning with a 2005 car theft and drunk driving conviction. He and an accomplice were subdued by Good Samaritans in 2006 after the pair assaulted an elderly man and stole his liquor and cigarettes. And in 2008, Mohamed was charged with breaking and entering and stealing.

'Changed man'

He pleaded guilty to numerous charges in each case.

"I as a lawyer believe in my client in that in my opinion he is a changed man, those mistakes are long ago, and that he presents himself as a good man," Khan said.

Mohamed was barred access to a standard refugee claim hearing — the most common channel through the Immigration and Refugee Board of Canada — but he wasn't outright denied potential protection.

Khan filed a pre-removal risk assessment (PRRA) application citing fears that his tattoos and time spent in the West would make him a clear target for the al-Qaeda-linked group al-Shabaab were he deported back to Somalia.

"I do not ﬁnd that the applicant has established with objective documentary evidence that the difficulties he may face upon his return to Somalia differs from that of any other person returning to a country he/she has not inhabited for over 24 years," wrote the official who rejected the PRRA, stating there wasn't enough evidence to suggest Mohamed faced the threat of torture or death were he sent back to Somalia.

He then filed for judicial review at the federal level. Judge McVeigh sided with previous decision and denied that application.

'Not just anyone can come'

Khan feels his client could face danger in Somalia and still believes he deserves to be protected.

He also says Canadians should view the fact that Mohamed was filtered out of the refugee claim hearing process due to his criminal history as the justice and immigration systems functioning as they should.

"This case is a testament and this story should reinforce in the mind of the Canadian public that our system works," said Khan.

"Not just anyone can come to Canada and access our refugee protection system through the Immigration Refugee Board of Canada and then be able to stay."