This story was updated at 12:55 p.m.

A state judge has ordered the New York City Police Department to release records on a secretive program that uses unmarked vans equipped with X-ray machines to detect bombs.

The ruling follows a nearly three-year legal battle by ProPublica, which had requested police reports, training materials, contracts and any health and safety tests on the vans under the state's Freedom of Information Law.

ProPublica filed the request as part of its investigation into the proliferation of security equipment, including airport body scanners, that expose people to ionizing radiation, which can mutate DNA and increase the risk of cancer.

Richard Daddario, then the NYPD's deputy commissioner of counterterrorism, told the court in 2013 that releasing the documents would hamper the department's ability to conduct operations and endanger the lives of New Yorkers.

Disclosing them, he said, would "permit those seeking to evade detection to conform their conduct to the times, places and methods that avoid NYPD presence and are thus most likely to yield a successful attack."

But Supreme Court Judge Doris Ling-Cohan called the NYPD's argument "mere speculation" and "patently insufficient" to outweigh the public's right to know.

"While this court is cognizant and sensitive to concerns about terrorism, being located less than a mile from the 9/11 site, and having seen firsthand the effects of terrorist destruction, nonetheless, the hallmark of our great nation is that it is a democracy, with a transparent government," she wrote in her decision last month.

Nick Paolucci, a spokesman for the city's law department, said Thursday that the NYPD would appeal "because disclosing this sensitive information would compromise public safety."

The X-ray vans at issue are essentially a version of older airport body scanners mounted on a truck.

Only three years ago, airline passengers routinely went through X-ray machines known as "backscatters" at major airports, such as Los Angeles International, New York's John F. Kennedy and Chicago O'Hare. But citing privacy concerns, the TSA removed body scanners that emit X-rays and replaced them with machines that use technology that is considered less invasive and safer.

But X-ray vans continue to be used by law enforcement agencies. They were developed shortly after the 9/11 terrorist attacks by American Science & Engineering Inc. in Billerica, Mass., and deployed by the U.S. military in Iraq and Afghanistan to sweep areas for roadside and car bombs. Because they typically look like blank, white panel trucks, soldiers in Iraq nicknamed them "white devils."

U.S. Customs and Border Protection recently began using them at border crossings, ports, Border Patrol checkpoints and special events such as the Super Bowl.

Very little has ever been reported about the NYPD's use of X-ray vans. In fact, until ProPublica's lawsuit, the police department had never said anything publicly about them other than to confirm their existence.

The most extensive reference to the vans came in a book written by two ABC News reporters who chronicled a year inside the agency's bomb squad.

Describing the security around the 2004 Republican convention in New York, they wrote that every vehicle entering a street in front of the convention hotel was ordered to drive between two white vans, which X-rayed each vehicle for explosives.

While the NYPD has refused to release information about its use of the vans—even how many it has, how much they cost or how it ensures the safety of the public—other government agencies have not been so secretive.

For example, Customs provided ProPublica with more than 150 pages of records under the federal Freedom of Information law just three months after a reporter filed an identical request with them in 2012.

Moreover, multiple researchers have published studies revealing security flaws in the X-ray technology, in one case, after buying a backscatter machine on eBay.

"The information contained in the records requested from the NYPD will allow the public to assess the potential health, cost, and privacy concerns raised by the NYPD's use of this vehicle," ProPublica told the court.

ProPublica is represented in the case by Yale Law School’s Media Freedom and Information Access Clinic and David Schulz of Levine, Sullivan, Koch & Schulz.

The Customs documents and technical specifications—which are on the manufacturer's website—show that the van emits less than 10 microrems of radiation per scan. That's about twice as much as the old airport body scanners. But it's extremely low compared to medical X-rays and well within industry standards for acceptable exposure.

The National Academy of Sciences is expected to release a report this month on radiation exposures from the TSA's old scanners. Although those machines also met industry standards, a number of prominent scientists said TSA had failed to follow the health and safety principle to keep radiation doses "as low as reasonably achievable." The TSA had the ability to use a different scanner that could also find plastic explosives and weapons, but did not use X-rays.

"It's not that the radiation from these machines is very high," Peter Rez, an Arizona State University physicist, told ProPublica in 2012. "It's 'Does the benefit outweigh the risk?' "

The long-term health risks of low levels of radiation are unknown. But the National Academy has taken the position that the danger comes from cumulative exposure and that even trivial amounts increase the risk of cancer.

The X-ray vans—which reportedly cost between $729,000 and $825,000 each—are designed to find organic materials such as drugs and explosives. The rays penetrate the metal in a car or concrete in a building and scatter back to a detector, producing an image of what's inside. The van can scan while driving alongside a row of shipping containers or while parked as cars pass by. Customs agencies around the world have used them to fight drug and human smuggling.

But most Federal Drug Administration regulations for medical X-rays do not apply to security equipment, leaving the decision of when and how to use the scanners up to law enforcement agencies such as the NYPD.

The NYPD's policies are of particular interest because many agencies have adopted strict policies to address potential harm from backscatter X-ray scans. When Customs began using the vans extensively in 2010, the agency prohibited their use on occupied vehicles and required that people get out of the vehicles before they were X-rayed.

But because the NYPD has refused to release the department's policies and procedures, it's unclear how widely the vans are being used—if at all, whether they're being used to scan people or even if police are deploying them for routine patrols on busy city streets.

For example, the NYPD asserted in court records that it did not have any records detailing its policies for privacy protections, how long images from the X-ray vans could be kept or who in the NYPD could view the images.

That conflicted with a court affidavit from Daddario, the counterterrorism chief, who discussed such documents and why they shouldn't be disclosed.

Judge Ling-Cohan ordered the NYPD to pay ProPublica's attorney fees and explain in writing what effort they made to search for documents responsive to the request.

ProPublica's president Richard Tofel said he was "gratified that the State Supreme Court has so clearly rejected the Police Department's efforts to stonewall this important request for information that could affect public health and that has certainly cost taxpayers a lot of money."

"As the court makes clear, vague and wholly conclusory allusions to possible terrorist threats do not and should not create exceptions to our laws on government transparency," he said. "We are sorry to learn the NYPD had decided to waste more citizen time and taxpayer money by appealing this ruling."