A man facing execution in Missouri next month will be in court on Wednesday for what could be his last chance to prove his innocence.

The guilt of the man, Marcellus Williams, has been challenged for years, and he has come close to execution twice. But the hearing on Wednesday in St. Louis County will be the first time that a court will consider DNA evidence that could exonerate him.

The case is notable because it has put two law enforcement officials, the local prosecutor and the state attorney general, on opposite sides. The prosecutor, Wesley Bell, supports Mr. Williams’s bid for exoneration and has filed a 63-page motion to overturn his conviction. The attorney general, Andrew Bailey, has argued that Wednesday’s hearing should not even take place.

Mr. Bell, a Democrat, recently defeated U.S. Representative Cori Bush in the Democratic primary for her House seat in a heavily Democratic district, so he will very likely be heading to Congress in January. Mr. Bailey, a Republican who was appointed to his office midterm to fill a vacancy, fended off a primary challenge this month and is also likely to win the general election in the deeply red state.

In his short time in office, Mr. Bailey has opposed three wrongful-conviction claims, going so far as to try to keep people in prison after they have been exonerated. In the Williams case, he has asked both the trial court and the State Supreme Court to block the hearing.

Tricia Rojo Bushnell, executive director of the Midwest Innocence Project, which is representing Mr. Williams, said Mr. Bailey’s efforts were costly and counterproductive. “Especially if there’s an execution date, we should absolutely want this evidence to be heard,” she said. “But instead we’re going to use all of these resources, all of our state resources, to try to prevent a hearing from even happening.”