A man who allegedly said Allah instructed him to kill was charged Tuesday with stabbing and wounding two uniformed soldiers at a north Toronto military recruitment centre a day earlier.

While investigators were probing possible terror links, the city’s police chief said there didn’t appear to be any connection to terrorist groups, although it seemed the man had deliberately targeted military personnel.

“To date, there is nothing to indicate the accused is working with anyone or in concert with any organization,” Chief Mark Saunders said. “It will take some time to have a complete picture.”

The 27-year-old suspect, who has been identified as Ayanle Hassan Ali, is facing nine criminal charges which are three counts of attempted murder, two counts of aggravated assault, three counts of assault with a weapon, and one count of weapons dangerous.

Ali appeared in court on Tuesday and was remanded into custody. He is scheduled to be back in court on March 18.

Ali ‘s lawyer did not ask for a mental health evaluation “at this time,” and said that “he seems like a reasonably intelligent man.”

This is the accused in yesterday's attack on two Canadian Forces personnel @CityNews pic.twitter.com/wUH7LnHpcv — Cristina Howorun (@CityCristinaH) March 15, 2016

Police say the accused walked into the centre at 4900 Yonge St., north of Sheppard Avenue, on Monday afternoon. Ali allegedly walked past a master corporal stationed at the door of the centre and then stabbed him when he tried to stop him. He then stabbed another military member who tried to apprehend him.

Others in the room were able to take down the suspect.

Neither soldier has life-threatening wounds.

Canadians – and the @CanadianForces – will not be intimidated by terror & hate. May the CAF members injured yesterday make a full recovery. — Justin Trudeau (@JustinTrudeau) March 15, 2016

Toronto Police Chief Mark Saunders quoted the man as saying: “Allah told me to do this, Allah told me to come here and kill people.”

Saunders said Ali was born in Montreal but moved to Toronto 2011. He has no previous criminal history.

During attack, Chief says suspect was heard saying "Allah told me to do this. Allah told me to kill people". Ali is a Montreal native. — Tammie Sutherland (@citytammie) March 15, 2016

Following the arrest, the accused became “non-responsive,” Saunders said, meaning he refused to answer any police questions.

The police chief urged the public against any anti-Islam sentiment in the wake of the attack.

Public Safety Minister Ralph Goodale said it appears to have been an isolated incident and “there is no imminent threat to public safety.”

“Canadians can be assured that their police and security agencies are fully engaged and are discharging their responsibilities,” Goodale said in a statement.

“My thoughts are with the victims and their families.”

Police named the suspect as Montreal-born Ayanle Hassan Ali, 27, who moved to Toronto in 2011. At one point, they also spelled his first name as Ayanie, but offered no explanation for the mistake.

Toronto police are working with the RCMP, OPP, and CSIS to establish a motive.

“One of the things I want to be very careful of when it comes to the national security piece that we don’t go do that Islamophobia nonsense,” Saunders said. “I don’t want this categorizing of a large group of people; that would be very unfair and very inaccurate.”

A tweet on Prime Minister Justin Trudeau’s account said that “Canadians – and the Canadian Forces – will not be intimidated by terror and hate.”