None of the victims suffered life-threatening injuries, he said, though the police had earlier indicated that at least two were in serious condition. Police officers recovered two firearms and detained a third person, the chief said, though he did not say why.

Many details of the shooting remain unclear. At least one victim was shot just outside of the square, in front of a courthouse at a major intersection that was closed for the celebrations. The ceremonies at City Hall continued to their planned conclusion and without any apparent bolstering of the already high police and security presence.

The Toronto Transit Commission confirmed that two of its special constables had been involved in an arrest outside of a subway entrance about a block from the celebration. CP24, a television news channel, broadcast a photograph of several police officers pinning down a person near that entrance.

“It is disappointing and I’m sure a source of anger for more than just me that anyone would carry a gun and discharge it at what was otherwise a joyous celebration,” John Tory, the city’s mayor, said in a statement. “I hope those found responsible will be held to account to the full extent that the law permits.”

Statistics show that Toronto is a safe city by global standards, and when large crowds poured into downtown during the N.B.A. playoffs, they were largely peaceful. But gun-related crimes have been on the rise, spiking last year despite Canada’s tight controls on handguns.