OTTAWA -- An Ontario Court judge has struck down a cherished part of the Harper government's tough-on-crime agenda.

Justice Paul Bellefontaine ruled Friday in Oshawa, Ont., that Christopher Lewis -- a crack dealer who offered to sell an undercover police officer a gun -- should not have to face the mandatory minimum sentence of three years in jail for firearms trafficking.

Mandatory minimum sentences are the backbone of the Conservative reforms to criminal law.

But Lewis' lawyer, Jeffrey Mazin, said three years was far too much for someone who never had a gun, nor did he ever intend to sell one to the officer.

"Basically it was a sales pitch -- to keep the officer interested in further drug sales," Mazin, a Toronto criminal defence lawyer, said in an interview.

The federal government's 2008 changes to the criminal code increased penalties in a number of areas, including gun control, drunk driving and the age of consent.

The Oshawa case only dealt with the firearms trafficking part of the Tackling Violent Crime Act, in which offering to sell someone a gun carries an automatic three-year sentence.

Mazin argued that the mandatory minimum sentence in this case was too harsh, and would run up against the Charter of Rights and Freedoms provisions against cruel and unusual punishment.

"The reality is ... it's remarkably easy to commit in terms of the element of the offence. All you need to do is make an offer and intend that the recipient take it seriously."

The judge agreed, saying the penalty was disproportionate.

He gave Lewis one year in jail for the firearms offence -- although he also gave him an extra two years for other drug-related offences.

There are implications for other cases, Mazin said.

"(It) demonstrates that not all gun offences should be punished the same way. Different firearms offences can be committed in a myriad of ways, with different levels of culpability."

Lewis was convicted after selling crack cocaine to an undercover officer on a few occasions, and then offered to sell him a .45 calibre gun, Mazin said.

Mandatory minimums are included in several areas of the Conservative crime reforms, but they have drawn much criticism for being too inflexible and not effective in deterring crime.

Mazin said Friday's ruling was the first time a judge has struck down the mandatory minimum for firearms trafficking.

But it's not the first time a judge has challenged Ottawa's 2008 law. In February, Ontario Superior Court Judge Anne Molloy struck down a three-year minimum sentence for a first offence of illegally possessing a loaded gun.

A spokeswoman for Justice Minister Rob Nicholson offered little comment on Lewis' case Friday, but said the Conservative government believes that for certain offences a minimum period of incarceration is justified to protect public safety.

"Parliament acted because Canadians were concerned that the courts were not applying appropriate sentences for serious gun crimes," said Julie Di Mambro.

"In order to maintain the integrity of the court case, which is currently within the appeal period, we cannot comment further."