The High Court has backed the directive by the electoral agency barring voters within 400 metre radius from a polling station after casting their votes.
Justice Richard Mwongo said that the directive by the Independent Electoral and Boundaries Commission (IEBC) has a legal basis.
"I declare there is a legal basis for the establishment of a 400 metre radius from the centre of a polling station within which persons not involved in the counting of votes may, where necessary at the discretion of the IEBC, not be permitted to be," Judge Mwongo ruled Saturday.
However, the Judge said that the IEBC, chaired by Mr Wafula Chebukati, cannot evict or remove persons who live close to a polling station.
On Thursday, Mr Okiyah Omtatah, activist and Busia senatorial candidate, opposed the directive arguing that it is illegal to expel citizens from polling centres during voting.
"Article 86 of the constitution requires that the elections be transparent.
"The elections cannot be transparent when people are barred from participating in the counting and tallying of votes and announcing of results," his petition read.
Mr Omtatah said that the cordon will undermine the rights of members of the public whose homes or residences fall within the restricted areas.
"Kenyans have a legitimate expectation that they will vote, wait for results and then go home after the exercise but the order by IEBC will deny them this," the petition said.
The candidate had also sued the Attorney-General; it was lodged at Bungoma High Court.
Judge Mwongo said: "That where there are residences or homesteads within the radius of 400 metres from the centre of a polling station, the presiding officer and police officers at a polling station have no authority to evict or remove or handle the inhabitants and residents thereof in any manner which would keep them out of or away from the said residences."
He said that the IEBC should instead afford members of the public access to the "counted and signed results either at the entrance of the polling station or any other place that is convenient and accessible to the public".