Henry Kyle Frese had dreamed of working in the intelligence field his whole life; he gave up his Canadian citizenship and a longtime girlfriend to work in Washington. He was preparing to serve in Iraq last fall. Instead, he was arrested at his desk in the Defense Intelligence Agency and on Thursday was sentenced to 2½ years in prison for leaking classified information.

“It was never for personal gain or out of anger; it was never for political reasons,” Frese said at sentencing in Alexandria federal court Thursday. “At the time, I thought my reasons were important. . . . Looking back, I’m embarrassed at how foolish and weak they were.”

Frese, 32, was a counterterrorism analyst at the DIA from 2017 until last October. He admitted in February to sharing national defense information with a consultant and two reporters, one of whom he was dating.

In sentencing papers, defense attorney Stuart Sears said Frese “was particularly susceptible to pressure and influence” when his girlfriend, a reporter whose “career was stalling,” began asking him to share information. He ultimately helped both her and a colleague and shared intelligence with a consultant overseas.

Court records do not name the journalists but describe articles and tweets written by Amanda Macias of CNBC and Courtney Kube of MSNBC, both of whom cover national security. The articles in question revealed details on Chinese and Russian weapon systems.

Sears emphasized that Frese was not the only one providing classified information to the two reporters. He said Frese even urged Macias not to publish some details she had learned elsewhere, saying they would compromise U.S. sources, and that he aimed to share information that would do no harm.

“So, he alone will shoulder all of the blame, and he alone will be accused of all of the harm, even though he should not,” Sears wrote.

Leak investigations and punishments for leaks have been on the rise under President Trump, who has repeatedly denounced disclosures to the press.

Friends and family, including a former federal prosecutor and a captain in the Marine Corps, said in letters to the court that the crime was an aberration by a responsible person who always put others first. When he was arrested, Frese was preparing to serve in Iraq.

“Kyle will bend over backwards for people in need,” one of his three sisters wrote. “He . . . opens his heart to people because he wants people to be happy.”

Prosecutors had asked for nine years in prison, pushing back on the idea that Frese shared only information that was of minimal importance or soon to be declassified. Frese acknowledged that he misjudged the classification ranking on some of the information he shared, thinking it was not top secret when it was.

“While he may have believed himself an expert on certain topics based on the snapshot of information he reviewed, the defendant did not have access to the broader information” needed to “properly assess the risk of harm from the disclosure of specific national security information,” the government wrote in one filing.

“Even if he convinced himself it would cause no real harm . . . it’s not just helping someone out, it’s not just doing someone a favor, it’s not selfless,” prosecutor Danya Atiyeh said in court. “It’s a terrible betrayal.”