The High Court has ruled that section 66 of the penal code violates the Constitution.
The code criminalises the sending of alarming messages that are likely to cause panic and fear.
The case had been filed by blogger Cyprian Nyakundi.
Justice Weldon Korir ruled that the provision is too retrogressive to fit in a democratic country saying that it is difficult for one to express himself or herself without violating the said provision.
“It is difficult for one to express himself or herself without violating the said provision,” Justice Weldon Korir ruled.
The Penal Code states that “any person who publishes any false statement, rumour or report which is likely to cause fear and alarm to the public or to disturb the public peace is guilty of a misdemeanour.”
A person found to have committed this offence is, on conviction, subject to a custodial sentence not exceeding two years and/or a fine.
The blogger had moved to the High Court challenging a criminal case he had been charged with alarming publication contrary to the law.
In the charge sheet, Nyakundi is alleged to have unlawfully published a piece of false information.
Nyakundi is accused of tweeting: "Kenya power has been looted by Jubilee through Ken Tarus who got the Managing Director job using fake papers. This country is being led by criminals."