A young Canadian soldier has been sentenced to a four-year prison term and has been thrown out of the military for fatally shooting a fellow Canadian Forces member in Afghanistan.

Cpl. Matthew Wilcox was sentenced in a Nova Scotia military court Wednesday morning, more than two-and-a-half years after he accidentally killed his friend and colleague, Cpl. Kevin Megeney.

Wilcox accidentally shot Megeney, a 25-year-old friend and fellow Canadian Forces member, while they were in their tent at the Kandahar airfield on March 6, 2007.

Megeney died about a half-hour after he was shot in the chest.

At his military trial, Wilcox claimed he shot in self-defence believing that someone was pointing a gun at his back. The prosecution argued that he and Megeney were playing a game of "quick draw" when Wilcox fired his weapon.

On Wednesday, military judge Cmdr. Peter Lamont told Wilcox that his actions demonstrated a pattern of negligent behaviour that led to the death of a fellow soldier.

"He violated (the) trust of his colleagues," Lamont said in court. "He was highly trained...and in this period he willfully ignored instructions. His critical carelessness has had tragic consequences."

The judge indicated that he was obliged to give Wilcox the minimum sentence under the civilian Criminal Code.

"In this case, I'm unable to say how the offence can be considered any less grave for sentencing purposes just because it occurred overseas," Lamont said.

The 24-year-old Wilcox will also be banned from owning a weapon for five years under the sentence he received Wednesday.

While Wilcox was stoic as his sentence was handed down, family members openly wept in court.

Wilcox's lawyers intend to appeal the sentence and punishment.

The judge noted that Wilcox was young, has no previous record and has performed his duties to a commendable standard since returning to Canada. And he acknowledged the grief that the convicted soldier carries for unintentionally killing his close friend.

"There is no doubt he has suffered enormously from the loss of his platoon mate," Lamont said.

The judge did not specify whether Wilcox will serve this time in a civilian or military prison, CTV's Todd Battis reported by telephone from Sydney, N.S.

Appeal to be launched

His lawyers immediately filed to appeal both the sentence and the conviction that found Wilcox guilty of negligent performance of duty and criminal negligence causing the death of Megeney.

The judge decided late Wednesday that Wilcox will begin serving his sentence immediately, while he waits on the status of his appeal.

The victim's family has previously told the court that Megeney's death has caused major heartbreak for his surviving relatives -- his father takes 18 pills a day to deal with stress caused by his son's death and the family has rarely gathered since Megeney was killed.

The prosecution and Megeney's family had pushed for Wilcox to be dismissed from the Forces. They also wanted him to serve six years in prison for his actions.

Michel Drapeau, a retired Canadian Forces colonel and military lawyer, said that the sentence Wilcox received on Wednesday could have ramifications for the way that on-base safety is addressed.

"There are questions to be asked of the military: Is the training system, is the discipline system, is the supervision system up to standard in order to prevent such an occurrence in the future? And if that is so, then this trial doesn't put an end to it," he told Â鶹ӰÊÓ Channel during an interview from Ottawa on Wednesday morning.

Drapeau said the sentence was "severe" in some respects, as Wilcox did not intentionally shoot his friend and he could likely continue to serve his country.

"He is a young man, he is a reservist...he was remorseful and I think he could continue to serve his country and learn from it," said Drapeau.

With files from The Canadian Press