Sixty-two people have been charged with various electoral offences following highly-contested party primaries in Kenya.
A statement from the prosecutor's office said a serving MP is among those who have been charged.
The offences include the bribery of voters and incitement to violence.
Kenya's 8 August vote comes nearly a decade after disputed election results fuelled violence that left more than 1,000 dead and 500,000 displaced.
However the last elections in 2013 passed off relatively peacefully.
The prosecutor's office also ordered investigations over violent incidents in five regions in different parts of the country.
Analysts say that the primaries have been so hard fought because becoming an elected official brings many financial benefits.
In addition, in the regions where one party is dominant a victory in that party's primary is seen as a near guarantee of the candidate being elected.
The prosecutor's statement also said that a team of 135 prosecutors are on standby to deal with hate speech and incitement to violence cases to ensure a " secure environment for a free, fair and peaceful election".
Kenyans will be voting for candidates in four positions: the president, members of parliament, county governors and members of county assemblies.
President Uhuru Kenyatta is seeking a second term and will be facing his political rival Raila Odinga, who was picked last week as the presidential candidate by a coalition of opposition parties.