A U.S. District Court judge this week dismissed a lawsuit by six current and former Food and Drug Administration scientists whose private communications were secretly monitored by the agency after they complained about the safety of medical devices.

Judge Reggie B. Walton of the District called  the scientists’ claim that the FDA violated their constitutional rights by spying on their government and personal e-mail accounts “troubling.”

But he did not address the merits of the case, and concluded in a written ruling that the court does not have jurisdiction because the scientists failed to exhaust the administrative remedies they were required to go through before filing suit.

The scientists claimed that after they blew the whistle on medical devices they believed posed unacceptable risks to patients, they became targets of a wide-ranging, targeted surveillance of their e-mails and other communications by top FDA officials, with full knowledge of the U.S. Department of Health and Human Services, its parent agency.

The FDA acknowledged that the monitoring took place, but said its scope was limited and said the spying was within the agency’s rights to conduct, since the scientists had disclosed what the government described as proprietary company information on medical devices.

Tuesday’s ruling caps a bitter case that led HHS to issue new guidelines that put some limits on targeted surveillance of employees. The case also prompted the Office of Special Counsel, an independent agency that investigates disclosure of government wrongdoing and retaliation against those who report it, to warn federal agencies that monitoring their employees’ personal e-mail violated the law if the intent was to retaliate against whistleblowers. The White House distributed the warning to agencies across the government, an acknowledgment by the Obama administration that there are limits to employee surveillance.

Stephen M. Kohn, the scientists’ attorney, declined comment.

FDA spokeswoman Erica Jefferson said in a statement that the agency is “pleased with the court’s decision to dismiss a lawsuit against the agency involving six individuals who work for, or formerly worked for, the FDA, and concerning allegations about its handling of various medical device reviews and approvals.”

The surveillance of the FDA scientists — detailed in e-mails and memos they unearthed — took place over two years as they accessed their personal Gmail accounts from government computers. The scientists alleged in the lawsuit that information garnered this way contributed to the harassment or dismissal of all six of them.

All had worked in an office responsible for reviewing devices for cancer screening and other purposes. They brought their concerns to Congress, the White House and the HHS inspector general.

Walton wrote that the scientists “alleged no shortage of facts establishing that the defendants took, or threatened to take, a variety of prohibited personnel actions against them for their whistleblower activities.” He also said the e-mail surveillance would fall under the umbrella of “prohibited personnel actions, ” a series of no-nos for government agencies when dealing with federal workers.

But the judge ruled that federal Civil Service laws require the plaintiffs to pursue their claims through administrative channels before the court could consider the case. The case is still under review by the Office of Special Counsel.

Walton also rejected some of the scientists’ claims on the merits. They accused the FDA of violating the First Amendment with the spying by restricting the public’s opportunity to “associate” with the plaintiffs and get access to public information.

Walton wrote that that claim “amounts to nothing more than a generalized grievance,” that the U.S. Supreme Court has prohibited.

The case was dismissed without prejudice. The scientists could attempt to bring a new complaint after they have completed the administrative process.