WASHINGTON — The mysterious workings of a Pentagon office that oversees clandestine operations are unraveling in federal court, where a criminal investigation has exposed a secret weapons program entwined with allegations of a sweetheart contract, fake badges and trails of destroyed evidence.

Capping an investigation that began almost two years ago, separate trials are scheduled this month in U.S. District Court in Alexandria, Va., for a civilian Navy intelligence official and a hot-rod auto mechanic from California who prosecutors allege conspired to manufacture an untraceable batch of automatic-rifle silencers.

The exact purpose of the silencers remains hazy, but court filings and pretrial testimony suggest they were part of a top-secret operation that would help arm guerrillas or commandos overseas.

The silencers — 349 of them — were ordered by a little-known Navy intelligence office at the Pentagon known as the Directorate for Plans, Policy, Oversight and Integration, according to charging documents. The directorate is made up of fewer than 10 civilian employees, most of them retired military personnel.

Court records filed by prosecutors allege that the Navy paid the auto mechanic — the brother of the directorate's boss — $1.6 million for the silencers, even though they cost only $10,000 in parts and labor to manufacture.

Much of the documentation in the investigation has been filed under seal on national security grounds. According to the records that have been made public, the crux of the case is whether the silencers were properly purchased for an authorized secret mission or were assembled for a rogue operation.

A former senior Navy official familiar with the investigation described directorate officials as "wanna-be spook-cops." Speaking on the condition of anonymity because the case is still unfolding, he added: "I know it sounds goofy, but it was like they were building their own mini law enforcement and intelligence agency."

The directorate is a civilian-run office that is supposed to provide back-office support and oversight for Navy and Marine intelligence operations. But some of its activities have fallen into a gray area, crossing into more active involvement with secret missions, according to a former senior Defense Department official familiar with the directorate's work.

"By design, that office is supposed to do a little more than policy and programmatic oversight," the former defense official said, speaking on the condition of anonymity because much of the directorate's work is classified. "But something happened and it lost its way. It became a case of the fox guarding the henhouse, and I suspect deeper issues might be in play."

Navy officials declined to comment, citing the ongoing investigation and prosecution. "The Department of the Navy has fully cooperated with law enforcement since this investigation was initiated ... and will continue to fully cooperate," said Cmdr. Ryan Perry, a Navy spokesman at the Pentagon.

Prosecutors have said that the silencers were acquired for a "special access program," or a highly secretive military operation. A contracting document filed with the court stated that the silencers were needed to support a program code-named UPSTAIRS but gave no other details.

According to court papers filed by prosecutors, one directorate official told an unnamed witness that the silencers were intended for Navy SEAL Team 6, the elite commando unit that killed Osama bin Laden.

But representatives for SEAL Team 6 told federal investigators they had not ordered the silencers and did not know anything about them, according to the court papers.

Sorting out the truth has been made more difficult by the elimination of potential evidence.

At one pretrial hearing, a defense attorney for the auto mechanic, Mark S. Landersman of Temecula, Calif., accused the Navy of impeding the investigation by destroying a secret stash of automatic rifles that the silencers were designed to fit. Prosecutors immediately objected to further discussion in open court, calling the matter classified.

The destroyed weapons were part of a stockpile of about 1,600 AK-47-style rifles that the U.S. military had collected overseas and stored in a warehouse in Pennsylvania, according to a source familiar with the investigation.

If the foreign-made weapons were equipped with unmarked silencers, the source said, the weapons could have been used by U.S. or foreign forces for special operations in other countries without any risk that they would be traced back to the United States.

A different source, a current senior Navy official, confirmed that an arsenal of AK-47-style rifles in a warehouse in Mechanicsburg, Pa., had been destroyed within the past year. But that official suggested the issue was a smokescreen, saying that the weapons were being kept for a different purpose and that no program had existed to equip them with silencers.

In a separate move that eliminated more potential evidence, Navy security officers incinerated documents last year that they had seized from the directorate's offices in the Pentagon, according to court records and testimony.

Two Navy security officers have testified that they stuffed the papers into burn bags and destroyed them on Nov. 15, 2013 — three days after The Washington Post published a front-page article about the unfolding federal investigation into the silencers.

One of the security officers said it did not occur to her that the documents should be preserved, despite Navy policies prohibiting the destruction of records that could be relevant to lawsuits or criminal investigations.

The officer, Francine Cox, acknowledged that she was aware the Navy directorate was under scrutiny and that she had read the Post article shortly before burning the documents. But she said she did not think the papers were important.

"I didn't think the information we had was pertinent," Cox testified at a pretrial hearing in July. "If you don't tell me to hold on to something, I don't have to hold on to it."

Lee M. Hall, a Navy intelligence official who is charged with illegally purchasing the silencers and whose trial is scheduled to begin this month, argued that the burned material was crucial to his defense. He said the documents included handwritten notes and other papers showing the undersecretary of the Navy at the time had authorized the project.

"My notes would show I acted in good faith," Hall testified at the July hearing.

Stuart Sears, an attorney for Hall, declined to comment.

U.S. District Judge Leonie Brinkema rejected a bid by Hall's attorneys to dismiss the charges against him but was incredulous that the Navy had destroyed the documents.

"I don't find any nefarious evidence, or evidence of bad intent, but it sure does look to the court like negligence," she said.

On other occasions over the past year, Brinkema has questioned whether prosecutors were fully aware of what the Navy directorate was up to and whether they really wanted to expose its activities by taking the case to trial.

"We're getting deeper and deeper into a morass," she said at a hearing in March. "One of the things the government always has to think about is the cost- benefit analysis. At the end of the day, is this particular criminal prosecution worth the risk of having to disclose or reveal very sensitive information?"

Suspicions about the Navy directorate surfaced in January 2013 when one of its officials appeared at a Defense Intelligence Agency office in Arlington, Va., and asked for a badge that would allow him to carry weapons on military property, according to statements made by prosecutors during pretrial hearings.

The directorate official, Tedd Shellenbarger, flashed a set of credentials stamped with the letters LEO — an acronym for "law enforcement officer" — even though his office dealt primarily with policy matters and lacked law enforcement powers, the former senior Navy official said.

Shellenbarger's request prompted the Naval Criminal Investigative Service (NCIS) to obtain a warrant to search the directorate's offices at the Pentagon. Agents found badge materials and other documentation that led them to broaden their investigation, according to the former senior Navy official.

Shellenbarger and three other directorate officials were placed on leave, according to court records. Shellenbarger has not been charged and has since returned to work for the Navy. His attorney, David Deitch, indicated he might be called as a witness at Hall's trial.

"Mr. Shellenbarger has cooperated fully in providing truthful information to the government about his conduct, which was undertaken at the direction of his supervisors," Deitch said.

The badge inquiry led NCIS to discover emails and a paper trail pertaining to the $1.6 million contract to buy the silencers from Landersman, the California mechanic. Court papers describe him as a struggling small-business man who raced hot rods and had declared bankruptcy in July 2012.

He is the brother of David W. Landersman, the senior director for intelligence in the Navy directorate.

Prosecutors have referred to David Landersman in court papers as a conspirator in the case, but he has not been charged. He is a combat-decorated retired Marine officer. His attorney has said he committed no wrongdoing.

Mark Landersman has been charged with manufacturing, selling and shipping the unmarked silencers without a federal firearms license. His trial is scheduled to begin Oct. 27. One of his attorneys, Cary Citronberg, declined to comment.

Ordinarily, a clandestine weapons program requires reams of paperwork and legal review. No documentation has surfaced in court to indicate that Navy officials formally signed off on the silencer project, although many pretrial motions have been filed under seal.

Hall, the directorate official charged with illegally purchasing the silencers, has asserted that he received verbal approval for the secret program from Robert C. Martinage, a former acting undersecretary of the Navy, according to statements made during pretrial hearings.

Martinage was forced to resign in January after investigators looking into the silencer deal found evidence that he had engaged in personal misconduct, according to Navy officials. The officials said the misconduct was unrelated to the silencer contract.

Martinage is expected to be a key witness at Hall's trial. He declined to comment, saying, "I have been advised not to discuss any aspect of that matter while the case is pending."