Carlos Ortiz Jr. of Red Oak pleaded guilty in December to retaliating against a federal official.
Prosecutors said Ortiz was put on leave in May, pending termination and then proceeded to amass more than two dozen guns and make threats against Special Agent in Charge Robert Casey Jr.
Ortiz's attorney, Colleen Dunbar, said her client's family was having a hard time.
"Family and friends are having a hard time considering his exemplary performance as an FBI agent and ... in the United States Army to come, to fall this far," she said.
Prosecutors hoped for a 10-year sentence.
"It could have been a lot worse, and we anticipated this," Dunbar said. "We talked about this."
The testimony of family and friends painted a picture of a man who quickly spiraled out of control.
"For a man that's spent nearly 30 years of his life serving the United States government, both in the Army and the Federal Bureau of Investigation, to have this happen to him is awful," Dunbar said.
The 49-year-old former lawman had worked for the FBI since 1988. He has been in custody since his arrest last August.
Ortiz was fired at the time of his Aug. 25 arrest. Nobody was injured.
NBC DFW's Ashanti Blaize contributed to this report.