A homeless man is admitting that he attacked a church custodian, and will spend time in jail.

Thirty-two year old Gregory Lewis was sentenced to one year at the Natrona County Detention Center, after pleading guilty to a reduced misdemeanor charge of reckless endangerment.

Casper police say in February, a custodian at the River Of Life Ministries Church was cleaning when he heard a noise on the back loading dock.

He discovered Lewis sleeping on one of the pallets and told him to leave, but he refused.

The custodian later saw that Lewis had a knife and was charging towards him.

He was able to block Lewis’ attack by sticking his foot up in the air and then got behind a locked door and called police saying he was in fear for his life.

Lewis told investigators he was sleeping behind the church because no one would take him in, and that the custodian attacked him first, so he pulled out the knife to defend himself.