SALT LAKE CITY — A federal judge denied a death-row challenge Thursday from a Utah prison inmate whose double-murder case was chronicled in the book “Under the Banner of Heaven.”

The ruling brings Ron Lafferty, 76, a step closer to execution by firing squad, though his lawyer, Dale Baich, said he plans to appeal.

Lafferty was convicted along with his brother in the 1984 slayings of his sister-in-law Brenda Lafferty and her baby daughter after she resisted her husband’s entry into a polygamous group.

His lawyers argued that he suffered from mental illness, and his punishment was out of line with the life sentence given to his brother Dan Lafferty, among other objections.

But U.S. District Judge Dee Benson sided with state experts who found he was fit for trial. In weighing the two brothers’ different sentences, he pointed to evidence that Ron Lafferty had masterminded the killings. He’d claimed to have had a religious revelation sanctioning the slayings because of his sister-in-law’s resistance to his beliefs in polygamy.

An appeal of the new ruling would bring the case before the 10th Circuit Court in Denver. Any potential execution date would likely be at least two years away, said Tom Brunker with the Utah Attorney General’s Office.

Lafferty is one of the longest-serving death row inmates in the state. His case become well-known around the country when it was included in Jon Krakauer’s 2003 book about radical offshoots of The Church of Jesus Christ of Latter-day Saints.

Lafferty chose to die by firing squad when he was sentenced decades ago, though his lawyers have argued he wasn’t legally competent to do so. Utah subsequently phased out the firing squad, but brought it back in 2015 as a backup if lethal injection drugs are unavailable.

Benson also denied Lafferty’s claims last year that the use of the firing squad is cruel and unusual.