ST. LOUIS, Mo. (AP) — The Missouri Supreme Court halted the immediate release Wednesday of a man whose murder conviction was overturned — just as the man was about to walk free.

A St. Louis Circuit Court judge had ordered Christopher Dunn to be released by 6 p.m.

CDT Wednesday and threatened the prison warden with contempt if Dunn remained imprisoned. But the attorney general has been fighting Dunn's release. The situation was chaotic as the deadline set by the judge approached.

Corrections Department spokesperson Karen Pojmann told The Associated Press that Dunn was out of the prison facility and waiting for a ride. His wife told the AP she was on his way to pick him up. Minutes later, Pojmann corrected herself and said that while Dunn was signing paperwork to be released, the Missouri Supreme Court issued a ruling that put his freedom on hold.

St. Louis Circuit Judge Jason Sengheiser overturned Dunn’s murder conviction Monday, citing evidence of “actual innocence” in the 1990 killing. He ordered Dunn's immediate release then, but Republican Attorney General Andrew Bailey appealed, and the state Department of Corrections declined to release him.

St. Louis Circuit Attorney Gabe Gore filed a motion Wednesday urging the judge to immediately order Dunn’s freedom. “The Attorney General cannot unilaterally decide to ignore this Court’s Order,” Gore wrote.

A court filing said an attorney for the Department of Corrections told a lawyer in Gore's office that Bailey .