Prime Minister Justin Trudeau said Canada is examining its asylum system and will consider whether changes need to be made in light of the terrorist attack in Edmonton allegedly committed by a Somali refugee who had been ordered deported from the United States.

"We are looking into exactly what happened in this situation, but it's certain that we have asylum processes that needed to be followed rule by rule," Mr. Trudeau said in Ottawa. "We're looking into the whole system and we'll reflect on whether we need to do things differently in the future than the way they were done in 2012, but the priority is always making sure we're defending the values and rights of Canadians while keeping our communities safe."

Abdullahi Hasan Sharif, 30, crossed in to the United States on foot from Mexico in 2011 before he was ordered deported and travelled to Canada to claim asylum. He was investigated for alleged extremist beliefs in 2015, although no further action was taken. He stands accused of five counts of attempted murder in a series of incidents that involved driving into pedestrians and stabbing a police officer.

Story continues below advertisement

Mr. Sharif arrived in the United States via the San Ysidro, Calif., port of entry near Tijuana, Mexico, on July 12, 2011, according to the U.S. Customs and Border Protection Agency. He was carrying no documents and had no legal status to enter the United States, the agency said on Wednesday, and was immediately taken into custody. The threat of potential terrorists crossing into the United States on foot has long been a preoccupation in the politicized battle over the U.S.-Mexico border.

A U.S. immigration judge ordered that Mr. Sharif be deported to Somalia in September, 2011, and within months he was released and evaded U.S. authorities. He arrived at a Canadian border point in 2012 and had his refugee claim confirmed later that year.

It's not clear whether Mr. Sharif ever made a claim for asylum in the United States. An administrator at the federal immigration court in San Diego said she could not release that information, as did a spokeswoman for Immigration, Customs and Enforcement.

If he did make a claim, it was heard quickly. Mr. Sharif was processed in a matter of two months, which is in stark contrast to current estimates from the Southern California immigration courts, which are only now hearing asylum claims made four years ago.

Even if an applicant made an unsuccessful claim in the United States, he could still have his case heard in Canada. There is an exception to the Safe Third Country Agreement to allow people who have a family member in Canada to have their claim heard. And the definition of "family" under the agreement is broader than the one normally used in the immigration process, according to Raj Sharma, an Alberta immigration lawyer. It can include grandparents, and even uncles and aunts, he said.

In some cases, Mr. Sharma said, claims made in Canada are more likely to succeed because Canada not only protects those who meet the refugee definition under the United Nations convention, but also those considered "persons in need of protection."

"Our definition of a refugee is a touch broader than in the U.S.," Mr. Sharma said. "Let's say you're targeted by FARC in Colombia or you fear organized crime in Mexico or something similar in Somalia, the convention refugee definition doesn't lend itself well to that situation … So someone who has been rejected in the U.S. could very well succeed in Canada."

Story continues below advertisement

Public Safety Minister Ralph Goodale has said there was no information that would have raised red flags when Mr. Sharif entered Canada. He had no history of criminal charges in the United States.

Three years after he arrived in Canada, Mr. Sharif was flagged as a potential terrorist threat. The RCMP has so far declined to reveal any details of the 2015 investigation, except to say that it launched an investigation based on a tip that Mr. Sharif was "espousing extremist ideology."

He was not deemed to be a threat to public safety and the RCMP did not find sufficient evidence to lay a criminal charge or seek a peace bond.