A former captain in the U.S. Army Special Forces who last year admitted to spying for Russia was sentenced Friday to more than 15 years in prison by a federal judge in Alexandria.

Peter Dzibinski Debbins, 46, pleaded guilty in November to the espionage-related charge of conspiracy to gather or deliver defense information to aid a foreign government. He was living in Manassas, Va., before his August arrest, which followed a failed polygraph test, court records show.

“He conspired with the Russian intelligence agents for his entire service in the U.S. Army,” prosecutors wrote in a sentencing memo.

In court filings, Debbins said he was motivated by a combination of familial loyalty, financial opportunity and personal grievance against the U.S. Army. His mother came from the Soviet Union and, according to court documents, he described himself as a “son of Russia” who thought the United States needed to be “cut down to size.”

“His actions will likely endanger the force for many years to come,” Maj. Gen. John W. Brennan, who commands the Special Forces, told the court in a letter.

Assistant U.S. Attorney Thomas Traxler told Senior U.S. District Judge Claude M. Hilton that Debbins “personally betrayed the people he was serving with, including somebody who was serving under him.”

“My Detachment Commander sold me out to Russia,” one retired member of the Special Forces who served under Debbins wrote to the court. “To discover that the Russians recruited Debbins before he entered the military makes me question the screening process that allowed him to . . . receive the highest level of security clearance.”

Traxler said Debbins’s four-page letter to the judge in advance of sentencing “seeks to depict himself as the victim.” In the letter, Debbins wrote, “I felt trapped by my circumstances, didn’t know how to escape, and became reckless with my military career.”

Traxler asked for a sentence of 17 years.

Prosecutors said Debbins was first approached by Russian intelligence operatives in 1996, when he was studying abroad in Chelyabinsk and that he later married a local woman whose father served as a colonel in the Russian Air Force. As a member of the Reserve Officers’ Training Corps, Debbins already had a secret-level security clearance. He went on active duty with the U.S. Army in 1998, serving in South Korea — and sharing details of the deployment with the Russians.

In exchange, he was given $1,000, a bottle of cognac and a Russian military uniform, according to court records. Debbins told his handlers he was sharing information out of loyalty, not for money. But he later told U.S. law enforcement he hoped the relationship would help him establish a business career in Russia.

His handlers encouraged Debbins to join the Special Forces. In 2004, Debbins became a captain with a top secret security clearance and was deployed to Azerbaijan. He was stripped of his command and his security clearance was suspended when he brought his wife to the country and gave her a U.S. government cellphone. He was honorably discharged.

Debbins later told investigators that the experience left him bitter and wanting retribution. Over the next few years, he shared classified information on his Special Forces work in Eastern Europe, according to the court records. He also provided personal details on at least six team members, identifying one he thought might cooperate with Russian intelligence, according to a prosecutors’ sentencing memo.

In 2010, despite concerns over his ties to Russia and the security violation, Debbins was again granted a top-secret clearance. His Russian handlers encouraged him to find a U.S. government job, while he wanted to stay in the private sector, authorities said. He applied, unsuccessfully, for over a dozen jobs at the Central Intelligence Agency and National Security Agency before landing as an intelligence contractor analyzing Russian cyberactivity for both the U.S. Army and Defense Intelligence Agency. He even trained Defense Department employees on security and counterintelligence.

He also tried and failed to get jobs at the FBI and on President Donald Trump’s National Security Council. Debbins was a graduate of and teacher at the D.C.-based Institute of World Politics, a small but influential school in conservative foreign policy circles. Former Trump national security adviser Michael Flynn and military contractor Erik Prince both have ties to the school.

“Mr. Debbins made a series of terrible, life-altering decisions at a very young age,” said his lawyer, David Benowitz. He said that Debbins spent 20 hours being interviewed by FBI agents before his arrest and that “in his own way he tried to make amends by speaking out about Russian influence on many occasions.”

Debbins told the judge that he suffered from “undiagnosed post-traumatic stress disorder,” from various traumas throughout his life, and that “I did not have the health and mental acuity and fell into a conspiracy. What I did was wrong, and I have been atoning for the last 11 years.”

The federal sentencing guidelines suggested a sentencing range of 188 months to 235 months. Hilton said he felt that range was appropriate and imposed a term of 188 months.

“Debbins flagrantly and repeatedly sold out his country over the course of 14 years, including while he served as a Captain in the U.S. Army Special Forces,” Raj Parekh, acting U.S. attorney for the Eastern District of Virginia, said in a statement. “The defendant’s brazen disclosures to Russian intelligence agents jeopardized U.S. national security and threatened the safety of his fellow servicemembers. This prosecution underscores our firm resolve to hold accountable those who betray their sworn oath and bring them to justice for their exceptionally serious crimes.”