Lamu West MP Stanley Muthama has faced a crushing blow after the court nullified his election.
Justice Weldon Korir found the process had been marred by irregularities.
Mr Muthama, who vied on a Maendeleo Chap Chap ticket, and the Independent Electoral and Boundaries Commission were ordered to pay Sh3 million in costs of the suit filed by the Orange Democratic Movement's Rishad Amana.
Separately, celebrations broke out in Malindi and Kilifi in the morning after the court dismissed a petition against Governor Amason Kingi.
Following Kingi’s court victory, focus now shifts to Mombasa County where the verdict of an election petition against Governor Ali Hassan Joho will be announced on Thursday.
Hundreds of Kingi’s backers broke out of a packed Malindi court and poured into the streets after Justice Korir dismissed a petition by former Labour Cabinet Secretary Kazungu Kambi and proclaimed Kingi was validly elected.
They were led by Kilifi MCAs, county assembly speaker Jimmy Kahindi, and deputy governor Gideon Saburi.
Other celebrations were held at the governor’s office in Kilifi town.
Kingi and Kambi were not at the court to hear the verdict.
The judge said the petitioner had not demonstrated his claims of poll rigging to cause a nullification of the August 8, 2017 polls.
“Having considered the allegations made by petitioner and the evidence adduced in support of the case by the same, the only conclusion I can reach is that he has failed to prove his case,” said Korir.