Kenya's Court of Appeal on Friday rejected a government bid to make fundamental changes to the Constitution, in a new blow to President Uhuru Kenyatta who had initiated the controversial proposals.
A seven-judge panel confirmed an earlier High Court ruling that the way the reforms were introduced was illegal, a decision that will shift the political landscape with less than a year before the country goes to the polls.
President Kenyatta had argued that the initiative would make politics more inclusive and help end repeated cycles of election violence in the country, a hot-button issue that has divided the political elite.
Court president Daniel Musinga issued his ruling on the government's appeal of the earlier ruling after more than 10 hours of a televised session.
"The president does not have authority under the Constitution to initiate changes to the constitution," he said.
"A constitutional amendment can only be initiated by parliament... or through a popular initiative," he said, also announcing that Kenyatta could be sued in a civil court for launching the process.
The proposed reforms came about following a rapprochement between Mr Kenyatta and his erstwhile opponent Raila Odinga and a famous handshake between the two men after post-election fighting in 2017 left dozens of people dead.
The so-called Building Bridges Initiative (BBI) notably aimed to restructure the current winner-takes-all electoral system blamed by Kenyatta for poll unrest, by expanding the executive and parliament to more evenly divide the spoils of victory.
But it has been seen as a way to enable Mr Kenyatta -- who is barred from running for president again in the August 9 vote -- to remain in power by creating the post of prime minister.
Friday's ruling would allow the electoral process to follow its planned timetable -- subject to any appeal to the Supreme Court, the country's highest.
But it means the nation's key political leaders may have to rethink their strategies to build alliances before the vote, analysts said.
Kenya, with its diverse population and large ethnic voting blocs, has long suffered politically motivated communal violence around election time, notably after a 2007 poll when more than 1,100 people died.
The proposed amendments to the 2010 Constitution were approved by parliament in May and were then due to be put to a referendum.
But just two days later, the Nairobi High Court ruled they were illegal as the president did not have the right to initiate the process, only parliament.
Mr Kenyatta criticised the decision as "an attempt to stop the will of the people" and his government appealed.
Supporters of the initiative argued it would improve fairness in the electoral system and help curb violence, but critics warned it could undermine the country's democratic institutions.
BBI detractors also argued it would further burden a country struggling under a $70-billion debt mountain and push up parliament's already sky-high wage bill while creating more opportunities for patronage and corruption.
The reforms called for the creation of the posts of prime minister and two deputies, while the runner-up in the presidential poll would be designated as the formal opposition leader.
They also proposed the expansion of parliament with 70 new constituencies, while the Senate would have 50-50 representation between men and women.
Mr Kenyatta's pursuit of the reforms with Mr Odinga, a four-time presidential contender, has spurred speculation that he may seek to become prime minister in a power-sharing arrangement since he cannot run for president again.
Mr Kenyatta had initially anointed William Ruto -- who has served as his deputy since 2013 -- as his successor but the pair fell out several years ago after the president moved closer to Mr Odinga.
Friday's ruling will be seen as a moral victory for Dr Ruto, an ambitious politician who had opposed the BBI, and for the rule of law and justice in Kenya.
In 2017, the Supreme Court had annulled Kenyatta's election victory in a landmark ruling after Odinga claimed fraud, but he went on to win the rerun.
Nic Cheeseman, a professor at Britain's University of Birmingham said that under BBI, politicians would have been trying to form various alliances by promising people new jobs.
"It might be more difficult to manage those alliances going into the election if BBI isn't on the table and if those new positions haven't been created," he added.