A Supreme Court of Canada ruling Friday means the defence minister can appeal in the case of a Canadian soldier acquitted of sexually assaulting a female subordinate.

The court ruled unanimously that the country's National Defence Act, which governs the military justice system, is constitutional.

The decision stems from two sexual assault cases involving soldiers.

In one, warrant officer Andre Gagnon was found not guilty in 2014 of sexually assaulting then-corporal Stephanie Raymond in December 2011 at an armoury near Quebec City.

The Crown argued at Gagnon's court martial that Raymond was in a position of vulnerability and had been forced to submit to his sexual advances after a party.

Gagnon's lawyers said the sex was consensual and that she had followed him to the armoury.

Gagnon did acknowledge that Raymond never responded sexually as he touched her, kissed her and undressed her.

Raymond insisted at the proceedings her name not be protected under a publication ban.

The Defence Department appealed the not-guilty verdict and requested a new trial. It stated the military judge committed an error by submitting to the five-men jury the defence that Gagnon had a "sincere but erroneous" belief Raymond had agreed to the sex.

Gagnon then submitted a motion to have the appeal quashed, arguing the National Defence Act is partly unconstitutional.

The motion argued that the defence minister's involvement in court-martial cases violates the section of the Canadian Charter of Rights and Freedoms that guarantees prosecutorial independance and the right to a hearing by an independent and impartial tribunal.

The court martial's appeals court ruled in Gagnon's favour, a decision that prompted the defence minister to ask the country's highest court to rule on the constitutionality of the National Defence Act.

In Friday's decision, the Supreme Court wrote that the defence minister should be considered an independent party.

"The minister, like the attorney general or other public officials with a prosecutorial function, is entitled to a strong presumption that he exercises prosecutorial discretion independently of partisan concerns," the judgment read.

"The mere fact of the minister's membership in cabinet does not displace that presumption."

The decision sends the case to the court martial's appeals court, which will hear the appeal.

The 2014 proceedings were handled by a court martial because both Gagnon and Raymond were in the Canadian Forces at the time of the incident.