Mexico’s Senate has approved a controversial judicial reform under which judges will be elected by popular vote.
Its supporters say the changes will make judges more accountable to the Mexican people but critics argue it undermines the country’s system of checks and balances and will strengthen the power of the governing Morena party.
The bill has triggered strikes and protests, with demonstrators earlier breaking into the building where the vote was due to take place.
The Senate vote was the last major hurdle facing the legislation, which has the backing of President Andrés Manuel López Obrador.
During a dramatic late-night session, the debate had to be paused when protesters chanting “the judiciary will not fall” stormed the chamber where senators were gathered.
After lawmakers moved to a different building, the vote went ahead in the early hours of Wednesday local time.
Senators were called one by one by their names and asked to cast their vote.
Senator Miguel Ángel Yunes broke ranks with his opposition National Action Party and voted in favour of the reform, meaning it gained the two-thirds majority needed for constitutional change.
Legislators then continued to debate a number of points in detail before giving the reform its final approval.
Its passage is a victory for President López Obrador, whose term is coming to an end on 30 September.
The outgoing president had thrown his weight behind the reform after repeatedly clashing with Mexico’s Supreme Court, which during his six-year term has blocked some of his proposed changes in the energy and security sector.
The president has accused the judiciary of being “at the service of the powerful, at the service of white-collar crime”.
Under the new system, judges, magistrates and even Supreme Court justices will have to stand for popular election.
Among those who have criticised the changes is Supreme Court Chief Justice Norma Piña.
She warned the proposed model would “generate tension between judges’ duty to be independent and impartial and their need to make rulings which are popular in order to attract votes”.
“The demolition of the judiciary is not the way forward,” she said in a video posted to X, formerly known as Twitter, on Sunday.
The reform has proven highly divisive.
Law students and employees of the judicial sector held rallies in major Mexican cities to oppose it and many went on strike in protest.
But last week the bill sailed through in the Chamber of Deputies, where the governing Morena party has an absolute majority.
Morena and its presidential candidate Claudia Sheinbaum won by a landslide in the general election held in June, and Ms Sheinbaum backs the reform.
Critics fear the independence of the judiciary could be at risk with both the executive and legislative already dominated by Morena.
But President López Obrador said Morena’s overwhelming electoral victory shows a majority of Mexicans back his reforms.
There has also been concern over the judicial changes beyond Mexico’s borders.
Ken Salazar, the US Ambassador to Mexico, said the popular direct election of judges constituted “a major risk to the functioning of Mexico’s democracy”.
Investors also appear to have been spoked by the plans.
Mexico’s currency, the peso, fell in the days leading up to the vote as it became clear that Morena had secured the necessary support for it to pass.
While the popular election of judges has arguably proven the most controversial point, the reform also allows cases involving organised crime to be heard by judges who do not have to reveal their identity.
The idea behind “faceless” judges is to protect them from threats.
But rights bodies such as the Inter-American Court of Human Rights have previously said this undermines a defendant’s rights to a fair trial as it is impossible to determine if the judge may have a conflict of interest.