Toronto Mayor John Tory has expressed condolences to Fredericton and New Brunswick in light of Friday's "terrible shooting."

Tory says Toronto has seen similar terrible incidents and he understands the wider impact they have.

Police in Fredericton have a suspect in custody after four people were shot dead in a residential neighbourhood.

Two of those killed were police officers.

The incident comes just weeks after a man went on a gun rampage in Toronto's Greektown, killing two girls and wounding another 13 people.

In that case, the shooter was found dead following an exchange of gunfire with police.

"Unfortunately, we've had more than our own share of experience with these terrible kinds of tragedies and I understand completely how much they are very wounding to the community itself, leave alone the families of the victims, to whom I also express our condolences on behalf of all Torontonians," Tory said. "I also know that our Canadian communities, including Toronto and Fredericton, are resilient."

The mayor said the community will have to go through periods of mourning and anger.

"We're strong people and we're not going to let these kinds of things take us off our course in terms of the quality of life and how we live," Tory said.

Prime Minister Justin Trudeau was slated to help open a street festival in Toronto's Greektown on Friday evening that will include a memorial tribute to the shooting victims and those who tried to help.