LOCKPORT – A judge ordered a mental competency examination Thursday for a man accused of killing his girlfriend with a sledgehammer and a knife in the victim’s North Tonawanda home.

State Supreme Court Justice Richard C. Kloch Sr. said he was acting on his own to order the exam for Brian C. Lowry, 32, of Ypsilanti, Mich. He is charged with second-degree murder in the death of Heather M. Rylowicz, 34, of Lincoln Avenue. Her decomposing body was found Nov. 21, but prosecutors say she might have been killed as far back as Nov. 2.

Lowry, who had started a relationship with the woman last summer, was arrested Nov. 24.

Kloch said he encountered some opposition to the competency exam from attorneys in the case, but overruled them. He expects the results of the mental exam to be available by April 18. He ordered an evidentiary hearing in the case for May 9. Lowry’s trial is scheduled for June 17.