MADISON, Neb. (AP) — A man accused of stabbing to death a neighbor in northeast Nebraska will be examined to determine his competency to stand trial.

A judge granted the defense motion Wednesday for the examination of 49-year-old Rodolfo Castaneda-Morejon. He's pleaded not guilty to first-degree murder and use of a weapon, and his trial is scheduled to begin June 12.

Prosecutors say he killed 39-year-old Yosvanis Velazquez Gomez on Aug. 25 at a Norfolk apartment complex. Madison County District Court records say Castaneda-Morejon told investigators he confronted Velazquez Gomez about an inappropriate text message sent to Castaneda-Morejon's girlfriend, suspecting the two were having a secret relationship. The records also say Castaneda-Morejon acknowledged stabbing Velazquez Gomez several times.