The court’s decision marks the latest case to be set aside under new President William Ruto’s government, where prosecutors have withdrawn cases against some of his allies on similar grounds, drawing criticism from veteran opposition leader Raila Odinga.
"The application by Director of Public Prosecutions is hereby granted," Victor Wakumile, a magistrate at the anti-corruption court said in his ruling, warning that Gachagua could be “re-arrested” if “investigators find evidence on similar charges.”
Gachagua and several and his co-accused were charged with corruption in July last year. He has denied any wrongdoing.
Director of Public Prosecutions Noordin Haji asked the court earlier this month to allow the withdrawal of the graft charges against Gachagua citing a lack of evidence.
There was no challenge to the prosecutor's request to drop the case.
In a separate ruling in July, a court ordered Gachagua to repay 202 million shillings which it determined were the proceeds of corruption. He dismissed the verdict at the time, saying was intended to undermine his candidacy on Ruto’s ticket.
Odinga criticized the withdrawal of cases against unnamed government officials.
"Recent developments in which the Director of Public Prosecutions has moved fast to drop cases against government officials and the willingness of the Judiciary to dance to the tunes of the Executive, point to the fact that as a country, we are flirting with lawlessness," Odinga, who lost to Ruto, said in a statement.
A Judiciary spokesperson could not be reached for comment.
Anti-corruption watchdog Transparency International placed Kenya at 128 out 180 countries in its 2021 rankings, a drop of one place from the previous year.