A man accused of stabbing two members of Canada's military at a recruitment centre in Toronto on Monday is facing nine charges in connection with the attack.

Ayanle Hassan Ali, a 27-year-old born in Montreal, appeared in court Tuesday wearing white prison-issued overalls and with his hands cuffed behind his back.

The accused hung his head and looked down at the floor for most of a brief court appearance Tuesday, saying his name quietly when asked to do so. At one point, Toronto police spelled his first name as Ayanie, but offered no explanation for the mistake.

Ali faces:

Three charges of attempted murder.

Two charges of aggravated assault.

Three charges of assault with a weapon.

One count of carrying a weapon dangerous to the public.

Ali, who was remanded until Friday, will be back in court on March 18.

According to Toronto police Chief Mark Saunders, Ali said, "Allah told me to do this, Allah told me to come here and kill people," during the attack.

Outside court, David Burke, Ali's lawyer, told reporters, "This is a very, very serious incident and no one is going to pretend it's not.

"It's a very, very difficult situation he finds himself in," Burke added. "He seems very scared."

Burke said he was "not getting into whether [Ali's] remorseful" about Monday's attack.

Ayanle Hassan Ali, 27, a Montreal-born suspect charged in Monday's double stabbing at a Canadian Armed Forces recruiting centre in north Toronto, appeared in a Toronto court Tuesday. (Pam Davies/CBC) When Saunders was asked if it was a terror attack, he said, "We're certainly looking into it," but cautioned against jumping to any conclusions.

He noted it is too early to say if the accused was radicalized and urged the public against any anti-Islam sentiment in the wake of the attack.

"I don't want this categorizing a large group of people; that will be very unfair and very inaccurate," he said, adding he doesn't want to see any of this "Islamophobia nonsense."

Saunders said the man was carrying a "very large knife" and was unresponsive after the incident. The chief appealed to the public for tips or information, saying the accused is not co-operating with police.

Ali has no previous criminal record and there was nothing to indicate he is affiliated with any terrorist organizations, according to Saunders. He has been in Toronto since 2011.

Canadians - and the <a href="https://twitter.com/CanadianForces">@CanadianForces</a> - will not be intimidated by terror & hate. May the CAF members injured yesterday make a full recovery. —@JustinTrudeau

The attack took place at the Joseph Shepard Building at 4900 Yonge St., which is located just north of Sheppard Avenue in the northern part of the city. The building also houses Passport Canada and Service Canada offices.

Saunders said a man walked past a master corporal stationed at the door of the centre on Monday afternoon and then stabbed him when he tried to stop him. Authorities say he then stabbed a second military member who tried to apprehend him. Attempts to slash a uniformed female Canadian Armed Forces member were unsuccessful, according to the police chief.

The two victims were treated in hospital and have been released. None of the injuries were life-threatening.

Saunders said the incident could have been far more serious if a group of six to eight trained soldiers had not stepped in to take down the attacker.

Toronto police say a man walked into the federal building Monday and stabbed two members of the Canadian Armed Forces. (Natalie Kalata/CBC) Speaking to reporters Tuesday morning, Maj. Richard Silva with the Canadian Armed Forces said no "unusual activities" were observed before the attack.

"We continue to provide service at the Canadian Armed Forces detachment here in Toronto," he said. "[It's] business as usual, although we do remain vigilant to ensure the safety of Canadian Armed Forces members and anyone who visits our recruiting centres."

Some members of Canada's Muslim community denounced the incident Tuesday as a "hateful act of violence" in a statement provided to CBC News.

"We are deeply troubled to hear about the attack on our Canadian Armed Forces," said Lal Khan Malik, the national president of the Ahmadiyya Muslim Jama'at Canada.

"It is appalling and utterly disgraceful that anyone would carry out such an attack in God's name," he added.

The group said they are praying for "swift justice and the rapid recovery of those wounded in this hateful crime."

On Tuesday, Chief of Defence Staff Gen. Jonathan Vance expressed his "sincerest gratitude" to the soldiers who "bravely detained the attacker."

In a statement, Vance said, "We remain steadfast in our commitment to defending Canadians and Canadian interests" and "we remain undeterred by yesterday's attack."

Cdn Forces Spokesperson outside scene of double-stabbing: It's business as usual but we remain vigilant. <a href="https://t.co/3waUIuLtGk">https://t.co/3waUIuLtGk</a> —@CBCToronto

Public Safety Minister Ralph Goodale said the attack appeared to have been an isolated incident and "there is no imminent threat to public safety."

He said he wanted to reassure Canadians "that our national security and law enforcement partners are fully engaged in this matter and they're working very closely with local law enforcement."

Goodale said the federal government will be establishing "a new office of community outreach and counter-radicalization co-ordination to make sure Canadians have the knowledge and resources to be among the best in the world at countering trends toward radical behaviour.

"We want to preserve the open, inclusive and respectful nature of Canadian society, and in order to do that we have to be very good at preventing radicalization," he added.

A spokesman at the recruitment centre said it was the first such attack at the facility.

"They are very rare, very exceptional," Capt. Rony Khalil said, adding that "everything is back to normal today."

John Boileau, a retired colonel with 37 years in the Canadian Armed Forces, said he would be opposed to adding armed security at recruitment centres because they're supposed to be welcoming and accessible in order to encourage would-be recruits.

"I certainly would not recommend we start putting armed guards at recruiting centres," he told Metro Morning from his home in Halifax on Tuesday. "There are not enough folks in the armed forces to do that right across the country."

Boileau said he doesn't want "to see us go back to the times of the FLQ crisis when there was an armed soldier on every street corner of downtown Montreal.

"There's no way you're going to be able to counter a lone wolf [attacker] working by himself."