A former National Security Agency employee who sold classified information to an undercover FBI agent he believed to be a Russian official was sentenced Monday to nearly 22 years in prison, the penalty requested by government prosecutors.

U.S. District Judge Raymond Moore said he could have put Jareh Sebastian Dalke, 32, behind bars for even longer, calling the 262-month sentence “mercy” for what he saw as a calculated action to take the job at the NSA in order to be able to sell national security secrets.

“This was blatant. It was brazen and, in my mind, it was deliberate. It was a betrayal, and it was as close to treasonous as you can get,” Moore said.

Dalke’s attorneys had asked for the Army veteran, who pleaded guilty to espionage charges last fall in a deal with prosecutors, to be sentenced to 14 years in prison, in part because the information he sold in 2022 did not end up in enemy hands and cause damage.

Assistant federal public defender David Kraut also argued for a lighter sentence because he said Dalke had suffered a traumatic brain injury, had attempted suicide four times, and had experienced trauma as a child, including witnessing domestic violence and substance abuse. Research has shown that kind of childhood trauma increases the risk of people later engaging in dangerous behavior, he said.

Later, Dalke, who said he was “remorseful and ashamed”, told Moore he had also suffered PTSD, bipolar disorder and obsessive-compulsive disorder.

He denied being motivated by ideology or earning money by agreeing to sell the secrets. Dalke also suggested he had an idea that he was actually communicating with law enforcement but was attracted to the thrill of what he was doing.

Moore said he was skeptical of Dalke’s claims about his conditions since the defense did not provide any expert opinions or hospital records.