A 22-year-old man attempted suicide at a Nairobi court while being charged for defilement.

Joshua Maina continuously hit his head on the floor of the court, shouting that he was tired of life, wanted to die.

The court managed to intervene and prevent Maina from hurting himself.

Corporal Jackline Amakumba said the complainant reported the defilement case on April 30 2021 alleging that her daughter aged 16 was defiled by Maina between April 14 and 20, 2021.

"The girl was escorted to Nairobi women's hospital where she was treated and since the matter was reported on a Friday I was unable to fill the p3 form for the complainant, the following week the complainant went back to school," the officer said.

The court ruled that Maina should be detained for 5 days.

However, the accused's lawyer asked the court to allow Maina to undergo an age assessment to ascertain his exact age.