Mr Khalid Juma Walter allegedly committed the crime on October 27 at around 10 pm.
The middle aged man pleaded guilty to the charges before Chief Magistrate Daniel Ogembo. He told the court that he spends his nights at a field near State House and on that material day he had taken shelter at the compound because it was raining.
He further shocked the court when he said that he is a friend of President Uhuru Kenyatta and was on his way to see him, a statement that contradicted his earlier story.
During the hearing, Mr. Khalid Juma seemed confused and uncertain of what he was saying as he kept smiling and laughing while addressing the court.
Chief Magistrate Ogembo ordered that he be taken for a mental checkup at Kenyatta National Hospital to enable the court determine his mental status. The hearing will be on November 4.
Khalid also revealed to the court that it was not the first time for him to enter State House, adding that he had noticed part of the State House’s perimeter wall which he used as his entry point, is not in good condition.
This is not the first time that someone has trespassed into State House.
In July this year, a 16 year old budding musician, Matthew Maina was nabbed on suspicions of being an Al Shabaab member. He claimed he was on his way to see the president to seek help for his music recording.