HALIFAX - A military judge says officers in the Canadian military were partly to blame for lax firearms safety in Afghanistan as he sentenced a former reservist Friday to four years in jail for fatally shooting a fellow soldier.

Lt.-Col. Louis-Vincent d'Auteuil said Matthew Wilcox was well trained and "should have known better" than to point a loaded pistol at his best friend, Cpl. Kevin Megeney, on March 6, 2007.

However, d'Auteuil also said senior officers at Kandahar Airfield hadn't done enough to crack down on improper handling of firearms before and during the deployment of Wilcox's unit.

"No discipline was imposed other than warning soldiers," the judge said, referring to incidents where soldiers would fail to unload the magazines from their pistols after leaving a shooting range on the base.

"All combined brought an atmosphere ... where a human being forgot to unload his weapon, pointed and fired at somebody and killed somebody. He is responsible, but the Canadian Forces must be blamed for not having the proper leadership in the circumstances."

The judge convicted the Glace Bay, N.S., man earlier this week of criminal negligence causing death and negligent performance of a military duty in the death of Megeney, a reservist from Stellarton, N.S.

It was Wilcox's second conviction. An earlier verdict was set aside last year after his lawyers argued the military jury wasn't properly balanced.

During sentencing Friday, d'Auteuil said he would subtract the three-and-a-half months of jail time Wilcox, 26, has already served in military and federal prisons.

"The incident was out of character in terms of what you did and who you are," d'Auteuil told Wilcox.

The judge said he felt he had to apply the four-year sentence to Wilcox because it was the minimum penalty for the same offence in civilian law.

He also noted the Megeney family had suffered enormously from losing their loved one.

On Thursday, Megeney's mother, Karen, told the court: "Here's your life, and then there's a hole and nothing can fill it."

The judge also said the minimum sentence was applicable because Wilcox's senior officers had let his unit down.

"Leaders, section leaders, the company commanders ... created an atmosphere that let soldiers think if they forget to unload their weapons, it was not a big deal," he said.

The judge noted that during the trial the court saw videos and photos of other soldiers pointing their pistols at one another, violating military safety rules.

The prosecution had argued that Wilcox was playing a game of "quick draw" when the shooting occurred.

Wilcox disputed that version of events, testifying during both trials that he fired his Browning pistol in self defence when he noticed a gun pointed at his head as he unloaded gear inside the tent he shared with Megeney.

Defence lawyer David Bright said he understood the judge's decision to impose a four-year sentence, but argued that under military law it could have been a lower or a suspended sentence.

"Having regard to all of the circumstances of the offence, the failure of the chain of command to support him and basically abandoning him, that the judge should look at that and lower the sentence," he said outside court.

Bright said his client has 30 days to decide whether to seek an appeal.

Military prosecutor Anthony Tamburro said the Megeney family and the prosecution team were content with the sentence.

He said he's sure the military will take steps to avoid similar incidents.

"I think any time there's issues with weapons mishandling, there are concerns, and I'm sure the chain of command is taking steps to deal with that," said the prosecutor.

The prosecution argued for a six-year sentence while the defence wanted a one-year term.

Wilcox will begin serving his time at the Springhill Institution, a federal prison in central Nova Scotia.