WASHINGTON—The Justice Department dropped cases against five visiting researchers accused of hiding their affiliations with China’s military, in a major setback to a landmark effort to root out alleged Chinese intelligence-gathering in the U.S.

In brief court filings late Thursday and Friday, prosecutors said they would no longer pursue visa fraud and other charges against the scientists, including biomedical and cancer researchers in California and a doctoral candidate studying artificial intelligence in Indiana.

One of the visiting scientists, Tang Juan, had been scheduled to go to trial on Monday. Court papers filed in her case earlier this week show some Federal Bureau of Investigation analysts casting doubt on the value of the cases. Judges had dismissed parts of the cases against Ms. Tang and another researcher in recent weeks after finding that FBI agents hadn’t properly informed them of their rights against self-incrimination when interviewing them.

A photo of researcher Tang Juan, who was charged with visa fraud by the U.S.

A photo of researcher Tang Juan, who was charged with visa fraud by the U.S.

Photo: U.S. District Court/EPA/Shutterstock

The academics had been arrested last July in an FBI sweep that began after another researcher, Wang Xin, acknowledged to law enforcement—as he tried to leave the U.S.—that he had lied about his military service on his visa application to boost his chances of gaining admission to the U.S., and had been tasked with bringing back some information by a supervisor.

The U.S. ordered China to close its Houston consulate at the time, sending relations between the two countries to their lowest point in at least three decades and prompting the Chinese to order a U.S. consulate closed. The State Department cited evidence that allegedly showed consular officials helping visiting researchers evade scrutiny.

A man attempts to remove a plate in front of the U.S. consulate in Chengdu, China, last year. Chinese officials ordered the consulate closed after the U.S. ordered China to close its consulate in Houston.

A man attempts to remove a plate in front of the U.S. consulate in Chengdu, China, last year. Chinese officials ordered the consulate closed after the U.S. ordered China to close its consulate in Houston.

Photo: ALEX PLAVEVSKI/EPA/Shutterstock

Soon after, more than 1,000 Chinese military-affiliated researchers left the U.S., officials have said.

A senior Justice Department official said the punishment for the crimes the researchers were charged with usually amounted to around a few months in prison, and the defendants had all been detained or under other restrictions in the U.S. since their arrest a year ago. That led the agency to determine that further litigation in the group of cases would unnecessarily prolong their departure from the U.S. and that their situations since their arrests amounted to sufficient punishment and deterrence.

A Justice Department spokesman said “recent developments” in the cases had prompted the department to re-evaluate the prosecutions. “We have determined that it is now in the interest of justice to dismiss them,” the spokesman, Wyn Hornbuckle, said, adding that the agency “continues to place a very high priority on countering the threat posed to American research security and academic integrity by the PRC government’s agenda and policies.” PRC is an abbreviation for People’s Republic of China.

A lawyer for Ms. Tang, who had been a visiting cancer researcher at the University of California, Davis, said she was pleased with the government’s decision and planned to return to China soon. A lawyer for neurologist Chen Song, who had been at Stanford University, said, “The government has done the right thing by dismissing this case”; and a lawyer for a researcher in artificial intelligence at the University of California, Los Angeles, Guan Lei, said he was proud of his client. Lawyers for the other two scientists, Mr. Wang, a visiting biomedical researcher at the University of California, San Francisco, and an artificial intelligence doctoral student at Indiana University, Zhao Kaikai, didn’t respond to a request for comment.

The case dismissals came days before the State Department’s No. 2 official, Wendy Sherman, travels to China for the first face-to-face meeting of senior officials in more than three months, amid escalating efforts of the Biden administration to confront Beijing on cyberattacks, human rights and other issues. The senior Justice Department official said there was no connection in the timing.

Lawyers for the researchers have generally argued that the scientists had been upfront about their home institutions and viewed their collaborations as part of a longstanding system of U.S.-China academic exchanges, dismissing any notion of a military plot.

According to documents filed in the case against Ms. Tang earlier this week, some analysts at the FBI more recently said the evidence in the cases showed no clear link between potential obfuscation on a visa application and the illicit transfer of U.S. technology to China—a primary concern for the FBI.

“Although there have been five arrests and one wanted scholar who remains at large as a result of this effort, only two of these six have had connections to technology transfer...leading [the FBI’s China Tech Transfer Analysis Unit] to determine that scrutiny of this indicator did not yield heretofore-unknown instances of technology transfer,” analysts within the FBI’s counterintelligence division wrote in a draft memo dated April 2021.

Prosecutors in Ms. Tang’s case said the memo didn’t reflect the government’s position, describing it as “preliminary in nature” and said it and another FBI draft document “misapprehend certain facts and contain multiple layers of hearsay.”

The memo also described experts on China’s People’s Liberation Army as disagreeing on the status of civilian PLA employees like doctors and scientists. It said that China’s PLA isn’t a direct analog to the U.S. military and that while the civilian cadre are at times required to wear a uniform, it appeared that they may not consider themselves soldiers. It also said the U.S. visa form “potentially lacks clarity.”

“While this indicates a potentially institutionalized indifference to U.S. visa policies, especially with respect to the civilian cadre, it remains an unreliable indicator of nefarious obfuscation of one’s military affiliations, and even less of an indicator of technology transfer activity,” the memo said.

The developments come after several years of arrests of academics on charges of hiding their ties to China. The Trump administration embarked on an aggressive effort to target rising concerns among U.S. authorities that American taxpayers are unwittingly funding Chinese scientific development and boosting China’s drive for global pre-eminence. Several academics pleaded guilty to such charges, but others have fought the cases, arguing that the government was misunderstanding the nature of international scientific collaboration.

The first such case to go to trial, involving a former mechanical engineering professor at the University of Tennessee, Knoxville accused of hiding his post at a Chinese university to get U.S. grants to support his research, ended in a mistrial last month.

The U.S. scientific community has increasingly criticized the government’s effort.

“The unprincipled theft of intellectual property by Chinese individuals, companies and the government is very real. However, this legitimate concern has spilled over into a distrust of Asian Americans who, like my parents, made the United States their home. Many of my Chinese American colleagues feel that they’re under increased and unjustified scrutiny by the U.S. government,” former Energy Secretary Steven Chu said at a congressional roundtable on the subject last month.

Write to Aruna Viswanatha at Aruna.Viswanatha@wsj.com