Peter Kimani and Jennifer Wairimu pleaded guilty to the charge of having sex in a place of worship after being caught on Oct. 3 at the Abubakar mosque in Gilgil, about 100 km north of Nairobi. Neither is a Muslim.
A worshipper heading for evening prayers found the couple having sex after investigating what the prosecution described as strange noises emanating from a dark corner of the mosque.
Kimani and Wairimu both pleaded for clemency at Monday's hearing, saying they were too drunk to know where they were. Kimani told the court he thought he was in a lodging house.
John King'ori, senior magistrate in nearby Naivasha, dismissed their plea.
"Having sex in a mosque is a most abominable thing to religion and only a custodial sentence can add justice to this," he said.