BALTIMORE — As a Vietnamese immigrant with imperfect English, Nghia H. Pho felt he was falling behind his fellow National Security Agency software developers in promotions and pay. So in 2010, after four years on the job, he began taking highly classified documents to his Maryland home to get extra work done at night and on weekends in an effort to improve his performance evaluations.

But in the five years that Mr. Pho, 68, stored the material on his insecure home computer, officials believe it was stolen by Russian hackers using the antivirus software installed on the machine. Mr. Pho worked for the N.S.A.’s hacking unit, then known as Tailored Access Operations, and his cache is believed to have included both hacking tools and documentation to go with it.

On Tuesday, as family members wept in the courtroom, Mr. Pho was sentenced to five and a half years in prison after pleading guilty to a single count of willful retention of national defense information.

Mr. Pho, a slender man with a thatch of white hair, chose to address the court in English despite the presence of an interpreter. “I did not betray the U.S.A.,” he said. “I did not send the information to anyone. I did not make a profit.”