Mr John Maina Njenga was also accused of having a firearm without a certificate.
However, Mr Njenga denied the charges when he appeared before Nairobi chief magistrate Aggrey Muchelule.
The prosecution urged the court to deny Mr Njenga bail, saying he might fail to turn up for trial.
In a sworn affidavit, the State said Mr Njenga had been on the run since November and that the police had been looking for him.
Prosecutor Stephen Chacha told the court an arrest warrant had been issued against Mr Njenga in a different case.
And, although he knew police were looking for him, he said, Mr Njenga had failed to make an effort to come to court until his recent arrest. But Mr Njenga said he had never had a firearm and that it had been planted on him by police officers.
He told the court that on the day the police arrested him, they had taken Sh470,000 from his car.
The money, he said, was from the sale of 880 bags of cereals. The magistrate will rule on February 15 whether to release Mr Njenga on bail.