A federal judge has ordered the Justice Department and the FBI to engage in a reenactment of the final day of the Waco siege, using infrared cameras to help determine whether any federal agents shot at the Branch Davidians inside their compound.

In a ruling late Monday, U.S. District Judge Walter S. Smith in Waco, Tex., agreed with attorneys for the surviving Davidians and special counsel John C. Danforth, both of whom had independently argued for the reenactment. The attorneys, as well as congressional investigators, have said that infrared tapes taken by the FBI during the assault show flashes suggestive of gunfire. The FBI has suggested the flashes were caused by sunlight reflecting off broken glass.

Citing concerns about the disclosure of classified law enforcement information, the Justice Department had rebuffed the Davidian requests for a reenactment to determine what may have caused the flashes. The FBI had offered to conduct a private demonstration, but for Danforth alone.

"The court is persuaded that one [infrared] test should be conducted, with participation and observation by the parties and the Office of Special Counsel," Smith wrote in his order.

Although FBI officials have voiced concern that duplicating the conditions of the siege would be difficult, if not impossible, FBI spokesman Bill Carter said, "We will make every effort to comply with the court order."

"The order is everything we had asked for," said Michael A. Caddell, a plaintiff's attorney for the Davidians.

In another signal that Danforth is aggressively pursing the question of possible government gunfire, his office asked the FBI late last week to turn over the more than 400 weapons used by federal agents during the April 19, 1993, assault that ended in a fire and left about 75 sect members dead. Carter said the bureau would comply with Danforth's request.

Danforth's office wants to conduct ballistics tests to see if bullets recovered from the scene match any of the guns' unique barrel rifling patterns. Spent shell casings will also be compared to FBI weapons' firing pins. Both tests could determine if any FBI agents' weapons were fired that day. However, gun barrels are often replaced and firing pins polished as part of regular annual maintenance, which might render the tests inconclusive.

The FBI and Justice Department have maintained that no government agents fired any shots that day, despite enduring gunfire from the Davidians. Plaintiffs attorneys in the wrongful-death suit filed by Davidian survivors contend that FBI agents fired at the Davidians during a blaze that broke out in the compound, preventing them from escaping.

Caddell has raised questions about why the FBI has never tested the guns. "We didn't have a reason to, because no one fired a shot," a senior FBI official said.