FORT DODGE, Iowa (AP) — A mental competency evaluation has been ordered for a man accused of beating to death a pastor outside a central Iowa church.

A judge approved a request Monday from the attorney for Joshua Pendleton, 36. Pendleton has pleaded not guilty to charges of robbery and first-degree murder in the slaying of the Rev. Allen Henderson.

“The defendant is acting in an irrational manner,” the defense motion said. “The defendant is unable to fully appreciate the nature of the charge, understand the proceedings, or effectively assist in the defense.”

The judge scheduled a hearing for Jan. 10 to determine whether there’s sufficient probable cause to suspend criminal proceedings. Pendleton’s trial had been scheduled to start April 28.

Officers sent to St. Paul Lutheran Church in Fort Dodge on Oct. 2 found Henderson lying unresponsive outside. He was pronounced dead at a local hospital.

Security footage shows a man who officers identified as Pendleton trying to get into the building, police said. Pendleton later acknowledged to investigators that he had fought with a man at the church.

Henderson, 64, was senior pastor at St. Paul and had served as a chaplain to area first responders.