The Oklahoma Supreme Court stayed the imminent executions of two murderers late Monday, ending a Kafkaesque legal showdown in which courts argued over jurisdiction even though the prisoners had successfully challenged the legality of the state’s secrecy in obtaining lethal drugs.

On Monday, lawyers for Clayton Lockett, who was to be executed at 6 p.m. Tuesday, and Charles Warner, who was to be executed at 6 p.m. next Tuesday, filed the latest of several appeals to the Oklahoma Supreme Court, asking it to set aside its odd jurisdiction battle and grant a delay while there was still time.

“The irreparable harm that would result from their executions cannot be overstated,” the lawyers wrote. On Monday afternoon, as prison officials prepared to go ahead with Tuesday’s execution, the court took action despite previous statements that a separate criminal court of appeals should handle the case.

The Oklahoma attorney general, Scott Pruitt, who had called the appeals nothing more than ploys to delay execution, reacted angrily to the decision. “The Oklahoma Supreme Court has acted in an extraordinary and unprecedented manner, resulting in a constitutional crisis for our state,” he said in a statement Monday evening.