(Reuters) – Colombian lawmakers passed a constitutional reform to the military justice system on Tuesday despite criticism by human rights groups that the law could open the door to impunity for abuses.

The reform basically changes a 2005 agreement that had placed members of the security forces who commit crimes under civilian authority, and not military courts.

Critics said the change would set back the government’s fight against Marxist guerrillas and criminal gangs.

President Juan Manuel Santos’ administration has started peace talks with the country’s largest guerrilla group, the Revolutionary Armed Forces of Colombia, or FARC, to try to end the war.

One major issue in any peace agreement will be, how it deals with rights abuses.

Under the new law, most offenses will by tried by military courts except for crimes against humanity, genocide, forced disappearances, executions, sexual violence, torture and forced displacement, which will be under civilian control.

Rights groups and the United Nations wanted more offenses covered under civilian courts. They have criticized the new measure, saying members of Colombia’s armed forces – which have a long history of rights abuses – could more easily escape punishment for such crimes.

The bill was approved by the Senate in the last of eight debates by a vote of 57-7, the Defense Ministry said in a message on Twitter. The reform had already been passed by the House of Representatives.

The Senate and House versions will now be reconciled and sent to the president to sign into law. A constitutional court will also examine the bill’s legality.

In Colombia’s decades of guerrilla war, tens of thousands of people have been killed and millions more displaced by fighting between military forces, leftist rebels and right-wing paramilitaries.