The Justice Department must search for and release historical records pertaining to a “purge” of gay and lesbian federal employees by the Federal Bureau of Investigation (FBI) under J. Edgar Hoover, the U.S. District Court for the District of Columbia ruled last week.

The documents are related to President Dwight Eisenhower’s Executive Order 10450, which ostensibly gave the heads of federal agencies the power to investigate and dismiss government workers if they posed a national security risk.

The lawsuit's plaintiff, along with LGBT historians, however, claim the actual purpose of the program was to allow the Hoover-led FBI legal authority to fire thousands of gay and lesbian employees across the federal government.

U.S. Federal Bureau of Investigations (FBI) Director J. Edgar Hoover sits at a table, speaking into several microphones in 1953. Hulton Archive/Getty Images

“This executive order in 1953 kicked off six decades of devastating discrimination against LGBT Americans, and these documents will reveal how that order was implemented and enforced,” Charles Francis, president of the Mattachine Society of Washington D.C., the lawsuit’s plaintiff, told NBC News.

“We’re talking about tens of thousands of people over the years investigated and ruined by this executive order; lives were shattered,” Francis added. “You were branded ‘immoral’ and ruined if you were labeled a homosexual in the 1950s ... and these papers remain locked away in federal vaults, and it’s time now for the Department of Justice and the FBI to work with us and release all of it.”

The district court ruled on Friday that the "FBI's response fails to demonstrate that their search was reasonably calculated to uncover all relevant documents."

The Morning Rundown Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Mattachine Society of Washington, D.C., an LGBT advocacy group, sought documents related to EO10450 under a Freedom of Information Act (FOIA) request in 2013 and last year filed a lawsuit.

"You were branded ‘immoral’ and ruined if you were labeled a homosexual in the 1950s … and these papers remain locked away in federal vaults, and it’s time now for the Department of Justice and the FBI to work with us and release all of it.”

Lillian Faderman, an LGBT historian and author of “The Gay Revolution,” called the district court’s ruling “very significant,” but she noted Eisenhower's executive order wasn’t the beginning of the U.S. government’s weeding out of gay employees.

“Truman in 1947 had signed [Executive Order 9835, known as the “Loyalty Order”], and that gave enough ammunition to the State Department to begin witch hunting homosexuals,” she said. “Throughout the early 1950s there were firings, but [Eisenhower’s order] gave even more ammunition.”

Faderman said the purge officially continued until 1975, when the U.S. Civil Service Commission (the government entity that actually did the firing) ended it, but she said it unofficially continued afterwards. And it wasn’t until 1995 that President Bill Clinton signed an executive order barring the federal government from denying security clearance to gays and lesbians solely on the basis of their sexual orientation.

U.S. District Judge Royce C. Lamberth in Friday’s ruling rejected arguments by the FBI that the search would produce a burdensome number of documents, and he was skeptical of claims that searches relating to Chief Justice Warren Burger — an assistant attorney general at the time who was tasked with enforcing EO 10450 — turned up no relevant results.

“The Government states that there is not a single responsive document amongst the results,” Lamberth wrote in the ruling. “Respectfully, this strains credulity.”

"It’s also important that our allies and other fellow citizens understand what the government did so we could do our best to avoid repeating history.”

Lisa Linsky, a partner at McDermott Will & Emery, the law firm that has been working pro bono with the Mattachine Society for the past five years to get these documents released, said the files are part of a broader story.

“It’s important to the preservation of LGBT American history,” Linsky told NBC News. “But it’s also important that our allies and other fellow citizens understand what the government did so we could do our best to avoid repeating history."

“Given the current environment, we need to do everything that we can to identify these historic documents, preserve them and make sure that the public is aware of the story of the government animus and discrimination toward LGBT people,” she explained, “because we’re at a time when the government — this particular administration — is not supportive of the LGBT community and preserving the civil rights that we have obtained.”

Francis agreed, saying the case is of “extreme relevance” today. He cited as an example the amicus brief the Justice Department filed just last week taking the position that discrimination based on sexual orientation is not protected under Title VII of the Civil Rights Act of 1964. This brief was filed the same day President Donald Trump sent out a series of surprise tweets proposing a ban on transgender service members.

Linsky said while this recent court decision is a “tremendous victory” for LGBTQ advocates, she noted there is no way to accurately predict when, if at all, they will actually receive the documents they’re seeking.

A spokesman from the Department of Justice said the department has “no comment on this particular matter.”

Follow NBC Out on Twitter, Facebook and Instagram