The federal government is getting closer to settling a lawsuit with current and former members of the Canadian Forces who allege rampant sexual misconduct and gender discrimination within the military, CTV News has learned.

Prime Minister Justin Trudeau has been criticized for his government’s attempts to quash the lawsuit, which alleges systemic sexual harassment, sexual assault and discrimination within the forces.

Justice Minister Jody Wilson-Raybould said Thursday that the government is prepared to settle cases when necessary.

“While I will not comment on the specifics of this case, it is my goal as attorney general to ensure that, when appropriate, we can settle these cases that are in the public interest,” Wilson-Raybould said.

Trudeau said Wednesday that arguments presented by government lawyers in the case do not align with his personal views.

The federal government argued in court filings that it does not “owe a private law duty of care to individual members within the CAF to provide a safe and harassment-free work environment, or to create policies to prevent sexual harassment or sexual assault."

Those filings appear to contradict the military’s own efforts to stamp out sexual misconduct. In 2017, more than two dozen service members were kicked out, and Chief of Defence Staff Gen. Jonathan Vance committed to eject any members found guilty of sexual crimes.

Earlier this week, Defence Minister Harjit Sajjan insisted that the government supports victims who come forward with allegations.

“We want to encourage people to actually come forward if they have any allegations or any type of concern, and that's very important,” Sajjan said.

With files from CTV’s Mercedes Stephenson