President Andres Manuel Lopez Obrador's contested judicial reforms, which were approved by lawmakers on Wednesday, will make Mexico the world's only country to elect all its judges by popular vote.
The leftist leader has frequently criticized the judiciary -- in particular the Supreme Court, which has impeded some of his attempted reforms in areas such as energy and security.
The judicial constitutional reforms were approved by a Congress dominated by the ruling coalition following a June presidential election won by Lopez Obrador's close ally Claudia Sheinbaum, who will take office on October 1.
Here are five things to know about the reforms:
The main -- and most controversial -- part of the reform plan is the popular election of judges and magistrates at all levels, including Supreme Court justices.
They will be chosen in extraordinary elections in 2025 and 2027, from among candidates proposed by the executive, legislative and judicial branches of government.
Until now, members of the Supreme Court were proposed by the president and ratified by the Senate, while the Federal Judicial Council appointed judges and magistrates on the basis of exams and merit.
Lopez Obrador says that the reforms are aimed at cleansing the justice system of corruption.
Opposition parties, rights groups and the United States have voiced concern that the changes will undermine judicial independence and leave judges at the mercy of drug cartels that use bribery and intimidation to influence officials.
Mexico will be the only country in the world to elect judges and magistrates at all levels, experts say.
"This does not exist in any other country," said Margaret Satterthwaite, United Nations special rapporteur on the independence of judges and lawyers.
"In some countries, such as the US, some state judges are elected, and in others, such as in Bolivia, high-level judges are elected," she told AFP before bill was passed.
Lopez Obrador's reforms will "place Mexico in a unique position in terms of its method for judicial selection," Satterthwaite said.
The reforms reduce the number of Supreme Court justices from 11 to nine, while their terms of office will be shortened from 15 to 12 years.
The plan also ends the lifetime pension that justices receive after completing their term, and prohibits them from earning more than the president -- a measure that already exists but is not enforced.
The reforms eliminate the Federal Judicial Council, which administers and oversees the conduct of judicial officials, and will create an administrative body and a judicial disciplinary tribunal.
The tribunal will evaluate and investigate judges' performance, may refer potential criminal cases to the public prosecutor's office and request impeachment proceedings in Congress against judges.
According to the Supreme Court, there is an impunity rate of 90 percent in Mexico, where around 80 people are murdered every day.
The top court has called for improvements in the capabilities of investigative bodies rather than what its chief justice called a "demolition" of the judiciary.
A system of faceless or anonymous judges will be used to safeguard their security and identities in trials involving organized crime.
The measure has been criticized by the Office of the United Nations High Commissioner for Human Rights in Mexico, which argues that it obscures the suitability and competence of judges.
A similar system has been applied in other countries in the region, including Colombia when it was facing a wave of drug-related violence in the late 1980s.
In El Salvador, under a state of emergency declared by President Nayib Bukele, authorities have detained thousands of alleged gang members without warrants who are then presented to faceless judges.