A man wearing black fired a handgun into restaurants and cafes in Toronto, killing a ten-year-old girl and an 18-year-old woman and wounding 13 others.

The mass shooting late on Sunday in Toronto's Greektown district came just three months after a van struck and killed ten people in an apparent attack directed toward women in the Canadian city.

Police declined to release the name of the 29-year-old gunman from Toronto who died after an exchange of gunfire with officers.

Police chief Mark Saunders 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 13 wounded ranged in age from 10 to 59, and suffered injuries ranging from serious to minor, Mr Saunders said.

He did not name the victims, who included eight women and girls, and seven men.

A Canadian politician who knew the 18-year-old identified her as Reese Fallon.

Nathaniel Erskine-Smith told CP24 television her devastated family has asked for privacy.

An online Facebook profile said she was a student of McMaster University.

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 in black clothes and a black hat walking quickly down a pavement 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 where the shootings occurred.

It was not immediately clear whether he killed himself or was killed by police.

A spokeswoman for the Special Investigations Unit, Monica Hudon, would not say whether the gunman was shot dead by police and said his identity was still being confirmed.

She said an autopsy would be performed on Tuesday.