Kenya's chief prosecutor has ordered police and an anti-corruption agency to investigate the country's election commission for alleged "irregularities and illegalities" in August's annulled presidential poll.

Director of public prosecutions Keriako Tobiko said on the wide-ranging investigations into the Independent Electoral and Boundaries Commission (IEBC) must be completed within 21 days.

READ MORE: Can Raila Odinga win Kenya's re-election?

The election board had said incumbent President Uhuru Kenyatta won the contest by 1.4 million votes, but the opposition said the country's electronic voting system had been hacked and the results were doctored.

A fresh presidential election between Kenyatta and opposition leader Raila Odinga is due on October 26.

Kobiko also said police and the anti-corruption agency should investigate allegations made by Odinga's National Super Alliance (NASA) against 11 senior IEBC commissioners accused of offences, and allegations from Kenyatta's Jubilee Party that two senior NASA leaders, Musalia Mudavadi and James Orengo, illegally accessed IEBC records.

Kenya's Supreme Court annulled the August 8 presidential election, in which Kenyatta was declared winner, after a legal challenge from Odinga.

The board overseeing the 2017 vote did not have all the tally forms when they announced the results, the court ruled on September 20.

It also said that some forms lacked security features such as watermarks, signatures or serial numbers, which calls their authenticity into question.

READ MORE: Why are Kenya's elections so bitterly contested?

As the Supreme Court delivered its full judgement, police used tear gas to disperse rival groups of protesters who had gathered outside the court.

US-based Human Rights Watch urged police to protect the judges involved in the ruling.

Dismas Mokua, a political risk analyst, warned of the potential of a constitutional crisis in Kenya.

"The IEBC should now go through the Supreme Court verdict with great detail, identify the illegalities and irregularities and address those issues to be ready for another election," he told Al Jazeera.