TORONTO — A man whose family said he suffered from psychosis and depression fired a handgun into restaurants and cafes in a lively Toronto neighborhood, killing a 10-year-old girl and an 18-year-old woman and wounding 13 others in an attack that has shaken the confidence of many in the normally safe city.

Authorities on Monday evening identified the suspect as Faisal Hussain, 29, of Toronto, who died in an exchange of gunfire with police. It was not immediately clear whether he killed himself or was killed by police.

The mass shooting in Toronto’s Greektown district Sunday night came just three months after a van struck and killed 10 people in an apparent attack directed at women.

A statement from the family of Hussain said he had severe mental health challenges, that he struggled with psychosis and depression. They said medications did not help him and the interventions of professionals were unsuccessful.

“While we did our best to seek help for him throughout his life of struggle and pain, we could never imagine that this would be his devastating and destructive end,” the Hussain family said.

“Our hearts are in pieces for the victims and for our city as we all come to grips with this terrible tragedy. We will mourn those who were lost for the rest of our lives.”

Police Chief Mark Saunders earlier said he would not speculate on a motive but did not rule out terrorism.

“It’s almost inconceivable that these things can happen,” said Mayor John Tory. “We were so used to living in a city where these things didn’t happen and as we saw them going on in the world around us (we) thought they couldn’t happen here.”

“This is an attack against innocent families and our entire city.”

The slain 18-year-old was identified as Reese Fallon, a recent high school graduate who volunteered for Canada’s Liberal party and was due to attend McMaster University in the fall. Her family said in a statement they were devastated.

“She was … smart, passionate and full of energy. It is a huge loss,” said Canadian Member of Parliament Nathaniel Erskine-Smith, who knew Fallon.

Flags at Toronto City Hall as well as at Fallon’s former high school, Malvern CI, and at school board buildings were lowered to half-staff.

“An engaging student, Reese Fallon graduated from Malvern CI just last month and was highly regarded by staff and loved by her friends,” the school board said in a statement, adding that support was being offered to students.

The 13 wounded ranged in age from 10 to 59, and suffered injuries ranging from serious to minor, Saunders said. He did not name the victims, who included eight women and girls, and seven men.

Dr. Najma Ahmed of St. Michael’s Hospital said five patients had been admitted in serious or critical condition and that three of the five underwent immediate lifesaving operations.

A video taken by a witness showed a man dressed all in black walking quickly down a sidewalk and firing three shots into at least one shop or restaurant in Toronto’s Greektown, a residential area crowded with Greek restaurants and cafes.

Witnesses heard many shots and described the suspect walking past restaurants and cafes and patios on both sides of the street and firing into them.

Ontario’s police watchdog said there was an exchange of gunfire between the assailant and two officers on a side street before the gunman was found dead near Danforth Avenue.

An autopsy will be performed Tuesday on the suspect.