Argentine lawmakers on Thursday passed a reform bill that paved the way for a controversial judicial reform, local media reported.

After an overnight debate lasting nearly 19 hours, the Chamber of Deputies, the lower house of the Argentine National Congress, approved the bill that will allow more members of the Judicial Council to be elected by popular vote.

The bill raised the number of Judicial Council members from 13 to 19, and the number to be elected by popular vote to 12, including three judges, three lawyers and six academics. The council is in charge of appointing and removing all national judges, except those on the Supreme Court.

The bill has been pushed through by the ruling party, but rejected by the opposition. Final approval is pending in the Senate.

The lawmakers also approved the creation of three Courts of Cassation or courts of last resort, which are aimed at reducing the number of cases reaching the Supreme Court and extending those legal proceedings by adding a new stage.