A man charged in a double stabbing at an armed forces recruiting centre in Toronto has been remanded in custody until next Wednesday.

Ayanle Hassan Ali, 27, appeared briefly in court Thursday dressed in a white T-shirt and grey pants.

His lawyer requested Ali receive medical attention as a precaution while in custody.

As Ali left the court, a crying woman pointed at him and said her son needed to eat. She declined to elaborate on her comments outside court.

Ali faces nine charges, including three counts of attempted murder, related to last week's incident.

Two soldiers were slightly injured when a man with a knife attacked them. Police allege the man said afterward that Allah told him to do it.