Ontario Premier Dalton McGuinty is reaffirming his support for mandatory minimum sentences in the wake of a court decision striking one down as unconstitutional.

An Ontario Superior Court judge ruled Monday that sending a first-time offender to prison for three years for illegally possessing a loaded gun is "cruel and unusual punishment."

Judge Anne Molloy wrote in her decision that reasonable people support reducing violent crime, but there is no "tangible evidence" that mandatory minimums accomplish that.

The ruling comes at a time when the federal Conservative government is pushing ahead with its controversial tough-on-crime agenda, including new mandatory minimums for drug and child sex crimes.

The office of the Ontario Ministry of the Attorney General has not yet said if it will appeal the decision.

In a tweet Tuesday, McGuinty writes that Ontario supports mandatory minimums for gun crimes, and notes the province is backing mandatory sentences in another case at the appeal level.

His chief of staff also pointed to a letter McGuinty wrote to all federal party leaders in 2005, days after a teenage girl was killed in a Boxing Day shootout on a busy street in Toronto filled with shoppers.

"Only severe penalties can clearly convey the gravity of gun-related crimes and our society's intolerance for them," McGuinty wrote on Dec. 29, 2005.

He called for Parliament to amend the Criminal Code to ban handguns and increase mandatory minimum sentences for all gun crimes, including a four-year minimum sentence for illegal possession of a handgun.

In 2008 the minimum sentence for the indictable offence of possession of a loaded restricted firearm was raised from one year to three.

Molloy ruled Monday that Toronto man Leroy Smickle was "very foolish" to have been taking pictures of himself posing with a loaded illegal gun, but the circumstances don't warrant a three-year penitentiary sentence.

Smickle was alone in his cousin's apartment in March 2009, taking pictures of himself posing with a loaded handgun to post on his Facebook page. Unbeknownst to him, police were amassing outside to execute a search warrant in relation to Smickle's cousin, who they believed had illegal firearms.

Police smashed in the door of the apartment with a battering ram and found Smickle with the gun in hand.