A federal magistrate has ordered a mental competency exam for inmate Russell Wilkinson, whose confession in April spawned an investigation into a murder-for-hire plot to kill Mount Pleasant real estate agent Nancy Latham.

Magistrate Judge Bristow Marchant today approved a motion from Wilkinson’s federal public defender, Ann Briks Walsh, to submit her client to a psychiatric evaluation. Assistant U.S. Attorney Nathan Williams consented to the motion.

Walsh wants to determine whether the 39-year-old Louisville, Ky., man “suffers from a mental disease or defect which would render him mentally incompetent” and unable to understand or assist in his defense, order states.

The exam will also seek to determine “the existence of insanity at the time of the offense” and whether he “suffers from diminished capacity,” the order states.

The evaluation will be conducted by the federal Bureau of Prisons.

The order comes one day after Wilkinson, one of four suspects in the murder-for-hire case, was arraigned on four federal counts that could land him behind bars for more than 30 years.

Wilkinson said little during the hearing in U.S. District Court in Charleston.

But in an interview last month with The Post and Courier, he spoke for more than an hour about the case, detailing names, dates, places and events. His recollections during the interview at the Charleston County jail mirrored statements contained in a federal affidavit.

Wilkinson said he was addicted to heroin, but he appeared lucid, sober and articulate, using words such as “dossier” to describe a kit of materials he and a codefendant allegedly received to carry out the hit.

The plot to kill Latham unraveled when Wilkinson revealed details of the scheme after he was pulled over by Charleston police on April 5 and found to have a .32-caliber pistol and ammunition inside his car, police have said.

Also charged in the case are Samuel Yenawine, 38, of Louisville; his girlfriend, Rachel Palmer, 36, of Louisville, Ky.; and his ex-wife, 37-year-old Wendy Annette Moore, who lives in the Charleston area.

Latham, who is treasurer of the S.C. Education Lottery Commission, is in the midst of a bitter divorce from her estranged husband, Chris Latham, a Bank of America executive who is vice president of Spoleto Festival USA and a board member of the Trident Technical College Foundation.

In motions in the divorce case and in a separate civil lawsuit, she has accused her husband of plotting with his live-in girlfriend — identified as Wendy Moore — to have her killed.

Chris Latham’s attorneys have denied those allegations, and he has not been charged with a crime. In court motions, they have insisted he is in fear for his life because he has allegedly been targeted for harm by his wife and her half brother, a convicted triple-murderer who is out on parole.

Reach Glenn Smith at 937-5556 or Twitter.com/glennsmith5.