A counterterrorism analyst for the Defense Intelligence Agency has been charged with leaking top-secret details about foreign countries’ weapons systems to two journalists, including a reporter with whom he apparently was romantically involved, federal authorities said Wednesday.

Henry K. Frese, 30, of Alexandria, Va., “was caught red-handed disclosing sensitive national security information,” according to the Justice Department, which billed the case as part of the Trump administration’s prosecutorial crackdown on leakers who provide such materials to the news media and public.

After a federal indictment of Frese was unsealed Wednesday, the department said in a statement that his alleged “unauthorized disclosure of TOP SECRET information could reasonably be expected to cause exceptionally grave harm to the national security.” Officials declined to say whether any harm resulted.

His alleged motive apparently was to advance the career of the female reporter with whom he had a relationship, the FBI said in an affidavit filed in court. Frese allegedly passed additional classified information to one of the woman’s female colleagues at “an affiliated but different news outlet.”

Although authorities Wednesday withheld the names of the two journalists, the affidavit and indictment describe Twitter messages and online articles that offer a road map to their identities. The reporters appear to be Amanda Macias of CNBC and Courtney Kube of MSNBC, both of whom cover national security.

A person familiar with the case, speaking on the condition of anonymity because the investigation is ongoing, confirmed that Macias and Kube were the alleged recipients of the leaked information and that investigators believe Macias had a personal relationship with Frese. The journalists and their media outlets did not respond to requests for comment.

Frese, who had a high-level security clearance, was arrested Wednesday morning as he arrived for work at DIA offices in Reston, Va., the FBI said. The indictment, issued by a grand jury in U.S. District Court in Alexandria, charges him with two counts of willful transmission of national defense information, each punishable by up to 10 years in prison.

It was not immediately clear whether Frese had retained a lawyer. A relative reached by The Washington Post said Frese’s family had no comment.

The FBI affidavit says “Journalist 1,” who was sharing a residence with Frese, published eight articles from May to July 2018 that included information from five classified DIA intelligence reports. DIA records show that Frese had earlier used his security clearance to gain access to the reports, even though the files “were outside his area of responsibility,” said U.S. Attorney G. Zachary Terwilliger of the Eastern District of Virginia.

During that period, Macias’s byline appeared on several online CNBC stories about the development, testing and deployment of new weapons systems by the Chinese and Russian militaries. The stories attributed information to “sources with direct knowledge of U.S. intelligence reports” and “sources who have seen U.S. intelligence reports.”

Frese and “Journalist 1” lived at the same Alexandria address from August 2017 to August 2018, and “it appears that they were involved in a romantic relationship for some or all of that time,” the affidavit says.

It says the reporter with whom Frese was involved introduced him to “Journalist 2,” who is a “more senior” reporter. “In early July 2019, Journalist 1 and Journalist 2 co-authored an article related to topics similar” to the 2018 stories.

On July 1 this year, Macias’s and Kube’s bylines appeared on an NBC News online story about China’s testing of anti-ship ballistic missiles in the South China Sea, with the information attributed to “two U.S. officials with knowledge of the matter.”

Frese joined the DIA as an intelligence contractor in January 2017 and was hired as a counterterrorism analyst 13 months later. The affidavit indicates that the FBI investigation involved an extensive review of Frese’s publicly available Twitter messages, as well as court-approved monitoring of some cellphone calls and texting records.

In a conference call with reporters Wednesday, Assistant Attorney General John Demers, the Justice Department’s top national security official, said the journalists’ electronic devices were not targeted for eavesdropping or a records review. He declined to say whether authorities intend to take any action against the reporters.

“Mr. Frese not only provided this information on his own, but the government believes he was taking direction from members of the media,” said FBI agent Alan E. Kohler Jr., head of the counterintelligence division in the Washington field office.

“He was searching for and accessing information that he had no reason to access,” Kohler said. “He did not need to know the information in the intelligence reports.”

In August 2017, then-Attorney General Jeff Sessions said in a speech that the Trump administration would ramp up enforcement against leakers of classified materials. Since then, six people have been charged with such crimes, Demers said.

One of the cases involved Reality L. Winner, a former Air Force linguist who was an intelligence contractor for the National Security Agency when she gave the news media classified information about Russian interference in the 2016 election. After her arrest in 2017, she pleaded guilty to federal charges and was sentenced to about five years in prison.

Magda Jean-Louis and Alice Crites contributed to this report.