TORONTO — The shots rang out, one by one and in bursts. Diners at the outdoor tables of the packed bars and restaurants along the Danforth, the main drag of one of Toronto’s hottest neighborhoods, dived for cover.

In the end, two people were killed, including a 10-year-old girl, and 13 were wounded.

The shooting Sunday night in a neighborhood that is home to hipsters and young families, where even the smallest house sells for $1 million, was the latest in a rash of violence that has sent the largest city in Canada reeling.

Toronto has awakened to a grim new reality: Despite Canada’s tight gun laws, the city is gripped with some of the same problems that bedevil larger places with laxer rules.

Late on Monday, the police identified the gunman as Faisal Hussain, 29, a Toronto resident. He was found dead close to the scene of the attack after the police exchanged fire with him.