Canada's military justice system doesn't contravene the Charter of Rights and Freedoms and can remain as is, the country's top court has ruled.

In a 5-2 decision released Friday, the Supreme Court found members of the military do not have the right to a trial by jury for serious crimes — such as sexual assault — if they are tried under the military justice system.

The top court weighed in after conflicting rulings in lower courts over what the charter says about the right to a jury trial — with one appeal stating a master corporal accused of sexual assault should have been tried before a jury, as he had requested.

There are no juries in the military system, only courts martial with a judge and a military panel made up of five members of the Armed Forces.

The decision revolves around a section of the charter that says anyone charged with a serious crime garnering five years of prison or more has the right to a trial by jury, except if that person is charged with an offence under military law before a military tribunal.

The majority on the Supreme Court found that the transformation of civilian offences into military ones was done through a validly enacted and constitutional section of military law.

While the majority opinion, written by Justices Michael Moldaver and Russell Brown, said simply being a soldier is enough to pursue a case under the military system, the two dissenting justices ruled the military connection to the crime should be stronger, for example, if the accused was on duty or the crime was committed on a military base.

The court's decision restores clarity to a military justice system that had been thrown into chaos while the Supreme Court ruling was pending, with dozens of cases postponed, abandoned or transferred to the civilian justice system.

After the decision was released, Col. Bruce MacGregor, the director of military prosecutions, said the ruling "further legitimizes the military justice system".

"It should make victims feel confident that this is a legitimate system that has evolved significantly and is on an equal level to the criminal justice system," he told reporters in Ottawa.

Defence Minister Harjit Sajjan also welcomed the Supreme Court ruling.

"Today's decision shows that the court recognizes the important role the military justice system plays in maintaining the discipline, efficiency and morale of the women and men in uniform," Sajjan said in a written statement Friday, adding there is still work to be done to make sure the military system is "better aligned with the civilian criminal justice system."

The ruling doesn't mean every serious crime committed by a soldier would be tried at a military tribunal. It remains at the discretion of military prosecutors whether to push cases to the civilian justice system, depending on a list of criteria such as public interest in the case and the views of the victim.