KENYA'S president has promised to "fix" the judicial system after the Supreme Court nullified last month's election in the former British colony.

As the country prepares for a fresh vote Uhuru Kenyatta accused the court of overturning the will of the people after he was declared the winner of the August 8 election. Human rights groups have said police killed at least 24 people in political unrest that followed the vote.

The court on Friday said the electoral commission had committed irregularities in the vote and called for a new election within 60 days.

Kenyatta responded that the country's judiciary has a "problem" and his administration will revisit the issue once it is re-elected.

Opposition leader Raila Odinga had petitioned the court challenging Kenyatta's win, claiming manipulation. The six-judge bench ruled 4-2 in favour of the petition.

It said the election commission "committed illegalities and irregularities ... in the transmission of results, substance of which will be given in the detailed judgment of the court" that will be published within 21 days.

Opposition members danced in the streets, revelling in the setback for Kenyatta, the son of the country's first president, in the long rivalry between Kenya's leading political families.

Odinga, a longtime opposition candidate and the son of Kenya's first vice president, had unsuccessfully challenged the results of the 2013 vote that Mr Kenyatta won.