Kenyan Supreme Court judges, from left to right, Deputy Chief Justice Philomela Mwilu, Chief Justice David Maraga, Jackton Ojwang and Isaac Lenaola. Picture: Ap/Sayyid Abdul Azim

Johannesburg - The bodyguard and driver of Kenya's deputy chief justice was shot and injured Tuesday evening, police said, just two days ahead of a controversial election re-run that has the East African nation on edge.

Titus Musyoka, a police constable attached to Deputy Chief Justice Philomena Mwilu, was shot at close range by gunmen on a motorbike, police officer Rashid Muhammed said.

The bodyguard was driving Mwilu's official car to run an errand when he was shot, Muhammed added. However, local media reported she was not in the car with him at the time.

The bodyguard was taken to hospital and police said the attack is being treated as robbery.

Tensions have been high in Kenya ahead of Thursday's presidential election re-run.

Kenya's Supreme Court nullified the result of the August 8 presidential vote - won by President Uhuru Kenyatta - due to irregularities after opposition leader Raila Odinga lodged a complaint.

New elections were then scheduled for October 26, but Odinga has since pulled out saying not enough was done to reform the electoral system ahead of the vote.

Kenyatta, who initially called the Supreme Court decision "a judicial coup", has however vowed the vote will go ahead.

There have been almost daily mass protests since the crisis began and foreign diplomats have warned a fair election cannot be guaranteed. 

Last week a senior official in the country's electoral commission fled to the United States citing death threats.