Nairobi - Kenyan legislators passed a new law on Tuesday in accordance with a demand from the World Anti-doping Agency that will allow the athletics powerhouse to take part at August's Olympic Games.
Kenya had been threatened with a ban from the Rio Games if the country did not apply new anti-doping legislation to tackle a spate of damaging positive drug tests.
The new law still needs to be signed off by president Uhuru Kenyatta before May 2 in order to meet WADA's deadline but Kenyan sports minister Hassan Wario is celebrating.
"Today is an important day for Kenya because the Anti Doping Bill has been passed. So Olympics here we come," said Wario.
Kenyatta previously said on April 11 that the adoption of the new bill was a priority.
International Association of Athletics Federations (IAAF) chief Sebastian Coe had threatened Kenya with an Olympic ban if they did not pass the bill into law.
The new law creates a national anti-doping agency and gives lawmakers the possibility to imprison for up to a year and fine those found guilty of doping up to $1,000.
As for those found guilty of supplying or administering doping products, they could face three years in prison and a $30,000 fine.
WADA will meet on May 12 to discuss the Kenyan case. They had already given the East African nation two extensions to get its anti-doping house in order.
Around 40 Kenyan athletes have been involved in drug scandals over the last three years, with only Russia suffering a worse blow to its credibility within the sport.
Kenyan Athletics Federation general manager Isaac Mwangi was suspended for six months at the end of February after being accused of corruption involving the alleged cover-up of positive doping tests.