OTTAWA - Public Safety Minister Vic Toews chided Canada's courts Tuesday for striking down mandatory sentences for gun-related crime after a deadly shooting in Toronto that killed two people and sent nearly two dozen others to hospital.

"We are very concerned about the courts doing that, because illegal firearms — especially those smuggled in from the United States ... minimum prison sentences are absolutely essential to create a strong deterrent against that kind of activity," Toews said in an interview with Prairie network Golden West Radio.

"These guns are being used by gangs in order to perpetrate the kind of violence that we've seen on our streets."

Earlier this month, an Ontario Court judge struck down the automatic three-year sentence for firearms trafficking, saying it was disproportionate. Justice Paul Bellefontaine said a crack dealer who offered to sell an undercover police officer a non-existent gun should not have to face the mandatory minimum sentence.

In February, another Ontario judge said sending a first-time offender to prison for three years for possessing a loaded gun amounted to "cruel and unusual punishment" and declared the minimum sentence unconstitutional.

Though Toews did not mention any specific cases by name, those two in particular appeared to be on his mind.

"I am concerned that some courts have been striking down mandatory prison sentences for those who have illegal firearms," he said.

The shooting at an east-end Toronto neighbourhood party Monday night left two people dead and injured 22 others in what police described as the worst incident of gun violence in the city's recent history.

Toews acknowledged that some disputes escalate very quickly to lethal violence.

"The access to firearms from illegal sources — especially firearms from south of the border — simply make that type of 'dispute resolution' so available," he said.

Toews defended federal actions to combat gun crime, noting the government had ushered in mandatory sentences for all serious firearms offences.

The Conservatives have also taken steps to ensure gang-related killings result automatically in a first-degree murder, while also singling out drive-by shootings and bolstering the fight against cross-border gun smuggling.

"We believe that our firearms legislation and the mandatory minimum prison sentences are having the desired impact," Toews said.

Justice Minister Rob Nicholson also defended the government's record on trying to rid the streets of smuggled handguns.

"We have taken steps to ensure that the border is open to legitimate business but closed to criminals and gun smugglers," Nicholson said in an interview with The Canadian Press. "And there's better security at our borders today than there ever has been.

"The government of Canada has made it a focus to tackle gangs, guns, drugs — we've been consistent throughout our mandate on that."

The opposition parties largely steered clear of politics following the Toronto melee.

"The people of Toronto have too often faced gun violence recently, something that should never become acceptable for any community in Canada," NDP public safety critic Randall Garrison said in a statement.

"Our communities and neighbourhoods should be safe places where families can gather for a summer barbecue without fear of this kind of violence."

Interim Liberal Leader Bob Rae encouraged those with any information about the events to speak and be heard. "We must honour the memory of those we lost by working together to ensure such an event never happens again."

Conservative Senator Don Meredith, a pastor, youth advocate, and community organizer, called the shootings "absolutely sick."

"It takes a village to raise a child and it will take a collective effort to solve the problem of gun violence; the police can’t do it alone," he said.