Mexicos president andrs manuel lpez obrador has secured supreme court approval for a controversial referendum on whether five of his predecessors should face trial for corruption, prompting critics to slam the ruling as a dangerous erosion of constitutional checks and balances.

Jess ramrez cuevas, government spokesman, called the 6-5 vote a transcendental step towards the construction of a true democracy and the fruit of a decades-long fight for the people to be heard.

Any referendum should by law happen in august but lawyers said mr lpez obrador could now push for the question to be on the ballot in next junes midterm vote.

The decision sparked a tide of concern that mr lpez obrador had now co-opted one of mexicos last autonomous institutions. he is the countrys most powerful president in a generation and has been waging a bitter campaign against media critics that they say undermines freedom of speech.

However, the justices later watered down the referendum question proposed by the president, removing any reference to past presidents and asking whether a process of clarifying political decisions taken in past years should be undertaken. the vague phrasing suggestedmembers of mr lpez obradors government may not be exempt.

Since taking office nearly two years ago, mr lpez obrador has concentrated decision-making and acknowledged that he demands blind loyalty to the project of transformation that he considers his mission.

Diego valads, a constitutional expert, called the ruling astonishing and several supreme court justices said it trampled human rights including the presumption of innocence.

Justice is not up for consultation, said justice javier laynez potisek. another, norma pia hernndez, said it was her duty not to yield to more pressures than those that came with being a constitutional judge.

But arturo zaldvar, court president, said it was not the institutions job to be a closed door but a bridge allowing people to intervene in major decisions.

Jess silva herzog, a prominent political commentator, said mr zaldvar was proposing the courts suicide and tweeted: the presidents intimidation worked.

Hours before the ruling, mr lpez obrador said during his daily news conference that it would be lamentable if the court did not back his bid to allow the people to decide whether presidents from 1988 to 2018 should be tried for corruption, social inequality, violence and many other calamities.

He had earlier this week vowed to seek to change the constitution if the supreme court voted against him.

Images shared on social media showed a crowd of government supporters gathered near the court chanting: we did it.

Jos miguel vivanco, executive director for the americas at advocacy group human rights watch, called it a constitutional delirium in mexico.

If they have evidence against ex-presidents, they should be investigated. otherwise, theres nothing to investigate. they cannot turn the country into a roman circus, he tweeted.

John ackerman, a law professor at the unam university and prominent supporter of the president, who is also married to the minister in charge of eradicating corruption from mexicos public administration, said mr lpez obradors openness to citizen not institutional erosion but precisely the contrary, it empowers democracy and...helps break with the old entrenched, corrupt practices.

The poll proposal will go to congress, where the president has a majority in both houses.