The Somali refugee accused of stabbing an Edmonton police constable on the weekend and running down four pedestrians was ordered to be deported from the United States in 2011 by a U.S. immigration judge, CBC News has learned.

In July 2011, U.S. Customs and Border Protection transferred Abdulahi Hasan Sharif into the custody of U.S. Immigration and Customs Enforcement at Otay Mesa Detention Center in San Diego, Calif., according to Jennifer D. Elzea, acting press secretary for the ICE office of public affairs.

Two months later, on Sept. 22, 2011, an immigration judge ordered Sharif removed to Somalia. Sharif waived his right to appeal that decision.

But Sharif was released on Nov. 23, 2011, on an ICE order of supervision, "due to a lack of likelihood of his removal in the reasonably foreseeable future," Elzea said in a statement to CBC News.

Sharif failed to report to the ICE enforcement and removal operations centre on his scheduled date, Jan. 24, 2012.

"Efforts by ERO San Diego to locate him were not successful," Elzea said.

Sharif had no known criminal history at the time of his dealings with ICE, she said.

Sharif crossed the border into Canada in 2012, Public Safety Minister Ralph Goodale said Monday in Ottawa.

Goodale said Sharif arrived through a "regular port of entry" and obtained refugee status at the time.

In 2012, immigration officials had no reason to red flag Sharif, Goodale said. Events in Edmonton over the weekend in no way indicate that Canada's screening process needs to be enhanced, or that the system failed, he said.

It's not known at present whether Sharif made an asylum claim while in the United States.

If he did make an asylum claim in the United States and that claim was rejected, normally Sharif wouldn't be able to make a claim in Canada under the Safe Third Country Rule, said Calgary immigration lawyer Michael Greene.

But Canada has made exceptions for minors or people with family in Canada, Greene said.

"An asylum seeker or potential refugee claimant, even if they've been in the U.S., can still in some cases make a refugee claim here," he said.

A spokesperson for the Office of the Minister for Immigration, Refugees and Citizenship Canada confirmed in an email statement Tuesday that Sharif "entered Canada from the United States through a regular Port of Entry in 2012 and was found to be a refugee‎ later that year.

"According to U.S. authorities, he was not detained for criminal activity," the spokesperson added.

"In general it is to be noted that only individuals who are inadmissible, including for serious criminality, would be ineligible to make an asylum claim. Being detained for immigration purposes in another country would not prevent someone from being able to make an asylum claim in Canada."

Now facing 11 charges, including attempted murder, Sharif made a brief first appearance Tuesday in an Edmonton courtroom.

Provincial court Judge Laura Stevens put the case over for six weeks to allow time for Sharif to get a lawyer and for the Crown to disclose whatever evidence it has.

Sharif, 30, is charged with five counts of attempted murder, four counts of criminal flight causing bodily harm, and one count each of dangerous driving and possession of a weapon for a dangerous purpose.

He remains in custody and his next court appearance is scheduled for Nov. 14. Stevens said bail can be spoken to any time before then with a few days' notice.

At his court appearance today, Sharif had bruises on his forehead and cheek that Edmonton police said resulted during two vehicle crashes on Saturday night. A Somali interpreter helped him during the proceedings.

Edmonton defence lawyer Chady Moustarah assisted Sharif for Tuesday's appearance only. He said a community member is in the process of retaining counsel for Sharif.

​Mahamad Accord, a member of Edmonton's Somali community who identified himself as being with the Edmonton Coalition of Human Rights and Justice, was at the courthouse to support Sharif.

Accord said he has been learning more about the accused, including that he has family in Canada — a brother in Toronto.

"Everyone who knows him [Sharif] said this is out of character," Accord said. "There is a mental health issue, we suspect."

Outside court, Moustarah said he believes Sharif is being held in the mental health unit at the Edmonton Remand Centre.

He said Sharif is experiencing "some confusion" because he hasn't had previous involvement with the justice system.

With files from Laurent Pirot, Janice Johnston