When Kenya’s high court this month pushed back against the president’s proposed constitutional changes, it was hailed as a sign of institutional strength in east Africa’s economic powerhouse.

A five-judge bench ruled the reform process was “unconstitutional, null, and void”. The decision was welcomed by many who believed that the biggest government overhaul in more than a decade was a veiled attempt by President Uhuru Kenyatta to consolidate political dynasties and effectively exclude his deputy-turned-rival, William Ruto.

“There are certain cliques within the political class, who want to use the constitution to address very short-term political interests and the beauty of this [court] judgment is that it attacks that particular attempt,” said Patrick Loch Otieno Lumumba, a law professor and Kenya’s former anti-corruption tsar.

But the victory, analysts fear, may be shortlived. Kenya’s recent election history has been characterised by ethnic violence and the ruling sets up a battle between the judiciary and the ruling class ahead of next year’s poll when Kenyatta is due to step down.

Advocates of the overhaul, which Kenya’s parliament had already passed, say it would lessen the chance of ethnic violence at elections by more evenly dividing the spoils of victory. It would carve out 70 new constituencies and spread more financial resources to regional governments. It would also create new senior positions in government, increasing the number of seats in parliament as well as an official position for the runner-up in the presidential election. “The fact of the matter is that we are a tribal society,” Kenyatta said in October last year as he launched the so-called Building Bridges Initiative or BBI. “This is what divides us.”

There are widespread fears that the 2022 elections could trigger unrest on the scale of 2007 and 2017 when 1,200 and 100 were killed, respectively, in post-election violence. Kenyatta and Ruto were both investigated by the International Criminal Court for their role in election violence, though the charges were dropped.

“Elections in Kenya have become a curse,” the BBI report says. “A winner-takes-all political system has only sharpened the ethnic competition for the presidency as people want one of their own as president since resources go with the presidency.”

But critics say the reforms would, in fact, grant more power to the political elite. Already in his second term, Kenyatta is constitutionally barred from running for the presidency next year. But analysts say he could seek the premiership if such a position were re-established under the proposed changes, echoing Vladimir Putin’s spell as Russian prime minister.

The proposed amendments, critics say, align Kenyatta and opposition leader Raila Odinga against Ruto. This could help Odinga gain “what he has always desired — to be the President of the Republic of Kenya” next year, said Lumumba. Both Kenyatta and Odinga are sons of Kenyan independence leaders.

Ruto, who has fallen out with Kenyatta and who, analysts say, wants to succeed his boss next year, welcomed the court victory. In a tweet on the court ruling, he wrote “There is God in heaven who loves Kenya immeasurably. Democracy is anchored in the rule of law.”

“The [legal] triumph is huge,” said Duncan Ojwang, the dean of law at Africa Nazarene University in Nairobi of the court ruling. “If somebody is to stand up to the executive and for the rule of law, it is judges who have tenure, and who are protected, and are, probably, not so temporary or transitional as politicians are.”

But government backers have said they will appeal the ruling. “We respect the decision of the court, but we don’t agree with it,” said Junet Mohamed, a senior member of parliament who is part of the team pushing the BBI. “This is not over yet.”

The Kenya Magistrates and Judges Association this week denounced the “daily attacks directed at individual judges” who ruled against the proposed changes, including some coming from “high ranking and powerful officials”.

For Nanjala Nyabola, a Nairobi-based writer and political analyst, the court has “done a really great job of defending the constitution”. She is dubious, though, of the final outcome: “The recent history of the executive, the legislature as well, ignoring court decisions doesn’t necessarily inspire confidence.”

Additional reporting by Donald Magomere in Nairobi