Nicholas Bickle, 34, made a brief plea for leniency before U.S. District Judge Roger Hunt in Las Vegas imposed the sentence.
"I just hope and pray the court affords me an opportunity to start over and be a productive member of society," Bickle said.
The judge noted that Bickle wore his Navy uniform during trial, but said he considered it a bid to impress the jury.
"The court recognizes and commends Mr. Bickle for his service to our country," Hunt said before adding that Bickle's time in the military didn't justify committing crimes.
Bickle, convicted in Las Vegas in October of 13 federal conspiracy and arms trafficking charges, appeared Tuesday in mustard yellow jail garb with the word "detainee" on his back and shackles on his ankles.
He surrendered to federal authorities in December after returning home to San Diego and receiving an "other than honorable" military discharge that stripped him of retirement benefits, health care and military honors including the Bronze Star. Officials say he served eight years in the Navy, including two deployments to Iraq.
Bickle's lawyer, John Arrascada, cast his client as a wayward war hero who gave his mental and physical health for his country and was so affected by post-traumatic stress that he couldn't tell right from wrong.
"Mr. Bickle was really along for the ride and not a mastermind," Arrascada said, telling the judge that Bickle got swept up in a conspiracy involving two friends and an arms dealer in Las Vegas -- all co-defendants who took plea deals and testified against him.
Hunt, who could have sentenced Bickle to almost 20 years, also ordered Bickle to serve three years of supervised release after prison.
"This crime in the court's view is very, very serious," the judge said, recalling the "veritable armory" of more than 40 weapons entered into evidence during trial. They included machine guns, sniper rifles and sighting scopes seized by an undercover federal Bureau of Alcohol, Tobacco, Firearms and Explosives agent.
"Illegal weapons, indiscriminately sold, can wind up in hands that can cause a lot of havoc," the judge said.
There was no way to know whether Bickle's stress was caused by battle or by being arrested and prosecuted, the judge added.
Arrascada, who sought a lenient sentence of five years, said outside court that he respected the judge's decision but will appeal.
Bickle's parents, Cliff and Barbara Bickle, of Ligonier, Pa., were in the courtroom but declined immediate comment.
Co-defendants Richard Paul of Durango, Colo., and Andrew Kaufman of Las Vegas face sentencing Wednesday.
They cooperated with prosecutors, along with Las Vegas resident Omar Aguirre, who was previously sentenced and is serving five years in prison.