A federal appeals court on Monday rejected environmental groups' bid to block the U.S. Army from detonating deteriorating explosives at an Iowa ammunition plant, clearing a legal hurdle for the planned controlled detonation.

The decision by the Eighth Circuit Court of Appeals came hours after President Donald Trump overruled the Army's decision to go forward with the operation, ordering the military to hold off until the court and the state's incoming governor approve it. The detonation therefore remains on hold despite the court's ruling.

The federal government had decided to blow up nearly five tons of hazardous material containing lead azide where it sits at the Iowa Army Ammunition Plant in Middletown, secured under layers of earth and concrete, deeming a controlled detonation to be the only safe way to treat it. The material, a volatile compound used to detonate munitions, has recrystallized during long-term storage, making it vulnerable to spontaneous detonation, according to the Army.

"A controlled detonation with attendant safety measures better alleviates the risk of irreparable harm than the risk of an uncontrolled explosion," the judges' opinion reads.

Trump said he would hold Governor-elect Rob Sand responsible if he blocks the detonation and the stored munitions explode spontaneously, as the Army has said is possible. Sand wrote on Monday afternoon that the administration "should make this decision based on the information they have from the people they brought in to do the job months ago and have been on the ground in Middletown for weeks," and said he had asked the administration to share that information with the public as soon as possible.

The Environmental Protection Agency issued a permit effective November 13 that authorized the controlled detonation, and the Army had planned to carry it out on November 20 before postponing it, first to November 23 and then to Wednesday, November 25. The Iowa Environmental Council and the Sierra Club had asked the appeals court to stay the permit, arguing it did not adequately protect residents against lead contamination. The government argued in response that there is an immediate risk the lead azide will spontaneously explode, especially in freezing temperatures, and that a planned detonation is safer than an unplanned one. There was no word as of Monday evening whether the Army would proceed with the detonation on Wednesday given the president's pause.