The sentencing laws, enacted as part of the Harper government's 2008 omnibus bill, could see people sent to prison for three years for what would amount to a licence violation, the Court of Appeal for Ontario ruled.
In that scenario, there is a "cavernous disconnect" between the severity of such an offence and the severity of the sentence, the court ruled.
The law as written could capture anyone from a person keeping an unloaded restricted gun, with ammunition accessible, in their cottage when their licence requires it to be in their home, to a person standing on a street corner with a loaded gun in his back pocket "which he intends to use as he sees fit," the court said.
"No system of criminal justice that would resort to punishments that 'outrage standards of decency' in the name of furthering the goals of deterrence and denunciation could ever hope to maintain the respect and support of its citizenry," the court ruled.
"Similarly, no system of criminal justice that would make exposure to a draconian mandatory minimum penalty, the cost an accused must pay to go to trial on the merits of the charge, could pretend to have any fidelity to the search for the truth in the criminal justice system."
The ruling is binding only in Ontario but judges across the country will likely take note.
Justice Minister Peter MacKay said the government is considering its next steps but it will "continue to defend the constitutionality of mandatory prison sentences for serious criminals."
"In the past, Canadians lost faith in the justice system when the punishment did not fit the crime — it is our government's commitment to restore confidence in the justice system," MacKay said in a statement. "Mandatory prison sentences show Canadians that the rights of criminals will no longer trump the rights of victims of crime."
Mandatory minimums are not new — both Liberal and Conservative governments have enacted them. And NDP justice critic Francoise Boivin acknowledged her party voted in favour of the gun legislation in 2007.
But, she said, the current government is treating the justice system with an us-versus-them mentality.
"The courts are not against politicians," said Boivin, who is a member of the Quebec bar. "Our job is not to be against the courts. But that's how they make the whole justice system look."
The Appeal Court heard six appeals together because each involved a constitutional challenge to a mandatory minimum sentence for various firearm offences. In its decision, the court struck down both the three-year mandatory minimum for a first offence of possessing a loaded prohibited gun and for five years on the second offence.
The ruling has no significant impact on sentences for people engaged in criminal conduct or who pose a danger to others, the court said, adding they should continue to receive sentences to emphasize deterrence and denunciation.
Lawyer Dirk Derstine, who headed up the main appeal, said there was a "mountain" of social science evidence that mandatory minimums do not have a deterrent effect.
The government will likely appeal to the Supreme Court of Canada, though it could probably get an amended law passed faster than the appeal could be heard at the top court, Derstine said.
"I think the court has cast a warning to Parliament that their ability to enact ever-more punitive criminal sanctions is not absolute, especially when they take away the ability of courts to fashion a fit and proper sentence," he said.
"Sentencing is a highly individualized process because the human condition is that we do things in a million different ways with a million different levels of culpability and sentencing ought to be a nuanced thing."
Liberal critic Sean Casey said his party believes in tough sentences for gun crimes, but also that "judges should be trusted."
"You are treading into dangerous territory with the constitutionality of these mandatory minimums," he said. "While they may be good politics for the Conservative base, they're not good policy. There is virtually no evidence that they actually make communities safer."
The law had been previously struck down by an Ontario Superior Court judge in the case of Leroy Smickle. He was in his cousin's house in his boxers, posing for a Facebook picture with a loaded handgun, when police burst in with a search warrant for the cousin, who they believed had illegal firearms.
Smickle was convicted of possession of a loaded prohibited firearm, but the judge ruled that it would be cruel and unusual to send the first-time offender to prison for a "very foolish" act for three years. Judge Anne Molloy gave Smickle a one-year conditional sentence.
But the Appeal Court said that sentence was "totally inadequate" as his behaviour posed a "serious and immediate risk to others."
A sentence of about two years less a day would have been appropriate without a mandatory minimum sentence, the court ruled, so his lawyers will have to return to court to argue his sentence.
Instead of Smickle, the court considered what is called a reasonable hypothetical.
It raised the case of John Snobelen, a former Ontario cabinet minister who was charged after his wife told police — during marital difficulties — about a gun he bought in the U.S. and forgot to register.
He received an absolute discharge because the Crown proceeded summarily. The three-year mandatory minimum is in place if the Crown proceeds by indictment, which is more serious.
By making it a hybrid offence, Parliament acknowledged that conduct captured by the offence runs the gamut, the court said. The Crown argued that for less morally blameworthy situations, the Crown will simply proceed summarily.
However, the court said, since those decisions are made early on, there will "inevitably" be cases that mean the Crown would have made a different choice as more facts emerge.
In Snobelen's case, if his wife had alleged Snobelen had used the presence of the gun to intimidate her, the Crown could have opted to proceed by indictment, the court wrote.
"In those circumstances, the three-year penitentiary term would surely be a grossly disproportionate sentence," the court ruled.
The Appeal Court also struck down a five-year mandatory minimum sentence for gun possession as a second offence.
Sidney Charles was convicted after a loaded gun was found in his bedroom at a rooming house. He challenged the law about what constitutes an earlier offence. The Appeal Court accepted his argument, not about his own case, but on another reasonable hypothetical.
Since the three-year mandatory minimum sentence was found to be disproportionate on a first offence, it "defies logic and principle" to leave the five-year mandatory minimum intact simply because of a prior offence, the court found.
Federal government lawyers had argued in support of the law, raising a spate of gun violence in 2005, which first prompted Ottawa to propose the stiffer penalties.
— with files from Bruce Cheadle in Ottawa
Also on HuffPost