BOSTON (AP) — A federal judge sentenced a Massachusetts Air National Guard member to 15 years in prison Tuesday for leaking classified military documents about the war in Ukraine, actions prosecutors said put the country’s national security at risk, endangered other military members and damaged U.S. relationships with its allies.

Jack Teixeira had pleaded guilty in March to six counts of willful retention and transmission of national defense information under the Espionage Act, nearly a year after his arrest in the most consequential national security breach in years. Wearing an orange jumpsuit in court, he showed no reaction as he was sentenced by U.S. District Judge Indira Talwani.

“Today, Mr. Teixeira has paid a very heavy price for laws he broke, for the incredible damage that he caused,” Acting Massachusetts U.S. Attorney Josh Levy said afterward. “This significant sentence sends a powerful message to every individual who holds a top secret clearance. Anyone who willfully threatens our national security by illegally disseminating classified information will face very serious repercussions.”

Jodi Cohen, special agent in charge of the Federal Bureau of Investigation’s Boston Division, told reporters the sentence held Teixeira accountable for “being one of the most prolific leakers of classified information in American history.”

“This former Air National Guardsman grossly betrayed our country and the oath he took to safeguard its secrets in order to boost his ego and impress his friends,” Cohen said. “This was not a victimless crime. The exceptionally grave damage he caused will impact our national security for decades to come.”

The leaks exposed to the world unvarnished secret assessments of Russia’s war in Ukraine, including information about troop movements in Ukraine, and the provision of supplies and equipment to Ukrainian troops. Teixeira also admitted posting information about a U.S. adversary’s plans to harm U.S. forces serving overseas.

Outside court, Teixeira’s attorney Michael Bachrach called it a “very difficult day” for his client and said Talwani imposed a “very severe punishment.” Still, he said, it was better than taking the case to trial, where Teixeira would have faced 30 years to life behind bars.

“It’s a significant sentence that will deter others,” Bachrach said. “But it’s also one that will allow him to self-reflect and grow. And we fully expect that he will be doing so.”

Before he was sentenced, Teixeira showed little emotion as he stood in court and apologized for his actions. The 22-year-old had previously admitted he illegally collected some of the nation’s most sensitive secrets and shared them with other users on the social media platform Discord.

“I wanted to say I’m sorry for all the harm that I brought and caused,” Teixeira said. “I understand all the responsibility and consequences fall upon my shoulders alone and accept whatever that will bring.”.

Afterward, Teixeira hugged one of his attorneys, looked toward his family and smiled before being led from court. His family left without commenting to reporters but his mother and others did submit letters to the court seeking leniency.

“I know Jack deeply regrets his actions and is ready to accept his punishment for his part in this situation,” his mother, Dawn Dufault, wrote. “While I understand the severity of his charges and the importance of ensuring justice, I implore you, Your Honor, to consider Jack’s true nature and his unique challenges, as I have observed over the years.”

The security breach raised alarm over the country’s ability to protect its most closely guarded secrets and forced the Biden administration to scramble to try to contain the diplomatic and military fallout. The leaks also embarrassed the Pentagon, which tightened controls to safeguard classified information and disciplined members found to have intentionally failed to take required action about Teixeira’s suspicious behavior.

Earlier in court, Assistant U.S. Attorney Jared Dolan told Talwani that 200 months — little more than 16 1/2 years – was appropriate given the “historic” damage from Teixeira’s breach in aiding America’s adversaries and hurting its allies. He also said such a sentence would send a message to anyone in the military who might consider similar conduct.

“It will be a cautionary tale for the men and women in the U.S. military,” Dolan said. “They are going to be told this is what happens if you break your promise, if you betray your country … They will know the defendant’s name. They will know the sentence the court imposes.”

But Bachrach told the judge Tuesday that 11 years was sufficient and would amount to half of the 22-year-old’s life.

“It is a significant, harsh and difficult sentence, one that will not be easy to serve,” Bachrach said, adding that Talwani should consider that his client was diagnosed with autism.

Defense attorneys had described Teixeira as an autistic, isolated individual who spent most of his time online, especially with his Discord community. They said his actions, though criminal, were never meant to “harm the United States,” and he had no prior criminal record.

“Instead, his intent was to educate his friends about world events to make certain they were not misled by misinformation,” they wrote. “To Jack, the Ukraine war was his generation’s World War II or Iraq, and he needed someone to share the experience with.”

Prosecutors countered in court filngs that Teixeira did not suffer from any intellectual disability and understood what he was doing was wrong. They wrote that his post-arrest diagnosis of “mild, high-functioning” autism was of “questionable relevance” to the proceedings.

Teixeira, of North Dighton, Massachusetts, was part of the 102nd Intelligence Wing at Otis Air National Guard Base in Massachusetts. He worked as a cyber transport systems specialist, which is essentially an information technology specialist responsible for military communications networks. He remains in the Air National Guard in an unpaid status, an Air Force official said.

Authorities said he first typed out classified documents he accessed and then began sharing photographs of files that bore SECRET and TOP SECRET markings. Prosecutors also said he tried to cover his tracks before his arrest, and authorities found a smashed tablet, laptop and an Xbox gaming console in a dumpster at his house.